Update ensemble.py
This commit is contained in:
parent
c559c1050d
commit
c2c8a892f8
@ -102,9 +102,8 @@ class EnsembleFTS(fts.FTS):
|
|||||||
l = len(self.models)
|
l = len(self.models)
|
||||||
if l == 1:
|
if l == 1:
|
||||||
return forecasts[0]
|
return forecasts[0]
|
||||||
w = [np.exp(-(l - k)) for k in range(l)]
|
w = np.array([np.exp(-(l - k)) for k in range(l)])
|
||||||
sw = sum(w)
|
w = w / np.nansum(w)
|
||||||
w = w / sw
|
|
||||||
ret = np.nansum([w[k] * forecasts[k] for k in range(l)])
|
ret = np.nansum([w[k] * forecasts[k] for k in range(l)])
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
Reference in New Issue
Block a user