diff --git a/pyFTS/models/incremental/Retrainer.py b/pyFTS/models/incremental/Retrainer.py index 044c2b6..e8f9f54 100644 --- a/pyFTS/models/incremental/Retrainer.py +++ b/pyFTS/models/incremental/Retrainer.py @@ -36,6 +36,7 @@ class Retrainer(fts.FTS): """The batch interval between each retraining""" self.is_high_order = True self.uod_clip = False + self.max_lag = self.window_length + self.order def train(self, data, **kwargs): self.partitioner = self.partitioner_method(data=data, **self.partitioner_params) @@ -49,12 +50,11 @@ class Retrainer(fts.FTS): ret = [] - for k in np.arange(horizon, l): + for k in np.arange(horizon, l+1): _train = data[k - horizon: k - self.order] _test = data[k - self.order: k] if k % self.batch_size == 0 or self.model is None: - print("Treinando {}".format(k)) if self.auto_update: self.model.train(_train) else: diff --git a/pyFTS/tests/general.py b/pyFTS/tests/general.py index 6021eda..1483cb8 100644 --- a/pyFTS/tests/general.py +++ b/pyFTS/tests/general.py @@ -10,7 +10,7 @@ import pandas as pd from pyFTS.common import Util as cUtil, FuzzySet from pyFTS.partitioners import Grid, Entropy, Util as pUtil -from pyFTS.benchmarks import benchmarks as bchmk +from pyFTS.benchmarks import benchmarks as bchmk, Measures from pyFTS.models import chen, yu, cheng, ismailefendi, hofts, pwfts from pyFTS.common import Transformations @@ -27,7 +27,9 @@ model = Retrainer.Retrainer(partitioner_params = {'npart': 30}, fts_method=hofts.HighOrderFTS, order = 2, window_length = 500, batch_size = 100) -model.predict(dataset) +#model.predict(dataset) + +Measures.get_point_statistics(dataset, model) ''' #dataset = SP500.get_data()[11500:16000]