Update smoothing.py

This commit is contained in:
Petrônio Cândido de Lima e Silva 2021-01-13 15:05:40 -03:00 committed by GitHub
parent 8bf3f7b1e9
commit 76617281b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ class MovingAverage(Transformation):
def apply(self, data, param=None, **kwargs):
steps = param if param is not None else self.steps
ma = [k for k in data[:steps]]
ma.extend([np.mean(data[k-steps:k]) for k in range(q, len(data))])
ma.extend([np.mean(data[k-steps:k]) for k in range(steps, len(data))])
return ma
def inverse(self, data, param=None, **kwargs):
@ -38,4 +38,4 @@ class ExponentialSmoothing(Transformation):
return mm
def inverse(self, data, param=None, **kwargs):
return data
return data