Bugfix on IncrementalEnsembleFTS
This commit is contained in:
parent
f7c1b4443e
commit
05c1f9f9da
@ -104,7 +104,7 @@ class EnsembleFTS(fts.FTS):
|
||||
elif self.point_method == 'exponential':
|
||||
l = len(self.models)
|
||||
if l == 1:
|
||||
return forecasts
|
||||
return forecasts[0]
|
||||
ret = np.nansum([np.exp(-(self.exp_factor * (l - k))) * forecasts[k] for k in range(l)])
|
||||
|
||||
return ret
|
||||
|
@ -19,7 +19,9 @@ model = IncrementalEnsemble.IncrementalEnsembleFTS(order=2, window_length=20, ba
|
||||
|
||||
model.fit(passengers[:40])
|
||||
|
||||
model.predict(passengers[40:])
|
||||
forecasts = model.predict(passengers[40:])
|
||||
|
||||
print(forecasts)
|
||||
|
||||
'''
|
||||
passengers = np.array(passengers["Passengers"])
|
||||
|
Loading…
Reference in New Issue
Block a user