From ae6923084ddcc73f610d0a22920adc94e396ac6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido?= Date: Tue, 7 Aug 2018 16:10:13 -0300 Subject: [PATCH] Bugfix in mackey_glass --- pyFTS/data/mackey_glass.py | 2 +- pyFTS/tests/nonstationary.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pyFTS/data/mackey_glass.py b/pyFTS/data/mackey_glass.py index 6743168..9e5ee12 100644 --- a/pyFTS/data/mackey_glass.py +++ b/pyFTS/data/mackey_glass.py @@ -1,7 +1,7 @@ import numpy as np -def get_data(b=0.1, c=0.2, tau=17, initial_values = np.linspace(0.5,1.5,18), iterations=1000): +def get_data(b=0.1, c=0.2, tau=17, initial_values = np.linspace(0.5,1.5, 18), iterations=1000): ''' Mackey, M. C. and Glass, L. (1977). Oscillation and chaos in physiological control systems. Science, 197(4300):287-289. diff --git a/pyFTS/tests/nonstationary.py b/pyFTS/tests/nonstationary.py index 4165fe4..ae038c7 100644 --- a/pyFTS/tests/nonstationary.py +++ b/pyFTS/tests/nonstationary.py @@ -8,8 +8,10 @@ import matplotlib.pyplot as plt from pyFTS.common import Util as cUtil import pandas as pd -from pyFTS.data import TAIEX, NASDAQ, SP500, artificial +from pyFTS.data import TAIEX, NASDAQ, SP500, artificial, mackey_glass +mackey_glass.get_data() +''' datasets = { "TAIEX": TAIEX.get_data()[:4000], "SP500": SP500.get_data()[10000:14000], @@ -54,7 +56,7 @@ partitions = {'CMIV': {'BoxCox(0)': 36, 'Differential(1)': 11, 'None': 8}, tag = 'benchmarks' -''' + for ds in datasets.keys(): dataset = datasets[ds] @@ -74,7 +76,7 @@ for ds in datasets.keys(): partitions=[partitioning], progress=False, type='point', file="nsfts_benchmarks.db", dataset=ds, tag=tag) -''' + train_split = 200 test_split = 2000 for ds in datasets.keys(): @@ -99,7 +101,7 @@ for ds in datasets.keys(): forecasts = model.predict(test) #print(forecasts) - ''' + partitioning = partitions[ds][tf] bchmk.sliding_window_benchmarks(dataset, 2000, train=0.2, inc=0.2,