Bugfix in ensemble.Ensemble
This commit is contained in:
parent
99b0203389
commit
4b8b0243d7
@ -64,6 +64,10 @@ class EnsembleFTS(fts.FTS):
|
|||||||
if model.has_seasonality:
|
if model.has_seasonality:
|
||||||
self.has_seasonality = True
|
self.has_seasonality = True
|
||||||
|
|
||||||
|
if model.original_min < self.original_min:
|
||||||
|
self.original_min = model.original_min
|
||||||
|
elif model.original_max > self.original_max:
|
||||||
|
self.original_max = model.original_max
|
||||||
|
|
||||||
def train(self, data, **kwargs):
|
def train(self, data, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
@ -12,6 +12,34 @@ from pyFTS.models.incremental import IncrementalEnsemble, TimeVariant
|
|||||||
|
|
||||||
from pyFTS.data import AirPassengers, artificial
|
from pyFTS.data import AirPassengers, artificial
|
||||||
|
|
||||||
|
from pyFTS.models.ensemble import ensemble
|
||||||
|
from pyFTS.models import hofts
|
||||||
|
from pyFTS.data import TAIEX
|
||||||
|
|
||||||
|
data = TAIEX.get_data()
|
||||||
|
|
||||||
|
model = ensemble.EnsembleFTS()
|
||||||
|
|
||||||
|
for k in [15, 25, 35]:
|
||||||
|
for order in [1, 2]:
|
||||||
|
fs = Grid.GridPartitioner(data=data, npart=k)
|
||||||
|
tmp = hofts.WeightedHighOrderFTS(partitioner=fs)
|
||||||
|
|
||||||
|
tmp.fit(data)
|
||||||
|
|
||||||
|
model.append_model(tmp)
|
||||||
|
|
||||||
|
forecasts = model.predict(data, type='interval', method='quantile', alpha=.05)
|
||||||
|
|
||||||
|
from pyFTS.benchmarks import benchmarks as bchmk
|
||||||
|
|
||||||
|
#f, ax = plt.subplots(1, 1, figsize=[20, 5])
|
||||||
|
|
||||||
|
#ax.plot(data)
|
||||||
|
#bchmk.plot_interval(ax, forecasts, 3, "")
|
||||||
|
print(forecasts)
|
||||||
|
|
||||||
|
'''
|
||||||
mu_local = 5
|
mu_local = 5
|
||||||
sigma_local = 0.25
|
sigma_local = 0.25
|
||||||
mu_drift = 10
|
mu_drift = 10
|
||||||
@ -33,7 +61,7 @@ model2 = IncrementalEnsemble.IncrementalEnsembleFTS(partitioner_method=Grid.Grid
|
|||||||
forecasts = model2.predict(signal)
|
forecasts = model2.predict(signal)
|
||||||
|
|
||||||
print(forecasts)
|
print(forecasts)
|
||||||
|
'''
|
||||||
'''
|
'''
|
||||||
passengers = np.array(passengers["Passengers"])
|
passengers = np.array(passengers["Passengers"])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user