221 KiB
221 KiB
High Order Fuzzy Time Series¶
Severiano, S. A. Jr; Silva, P. C. L.; Sadaei, H. J.; Guimarães, F. G. Very Short-term Solar Forecasting using Fuzzy Time Series. 2017 IEEE International Conference on Fuzzy Systems. DOI10.1109/FUZZ-IEEE.2017.8015732
Installing Dependencies¶
In [3]:
!pip install -U git+https://github.com/petroniocandido/pyFTS/
!pip install dill
In [5]:
Common Imports¶
In [6]:
import matplotlib.pylab as plt
from pyFTS.benchmarks import benchmarks as bchmk
from pyFTS.models import hofts
from pyFTS.common import Transformations
tdiff = Transformations.Differential(1)
%matplotlib notebook
Data Loading¶
In [7]:
from pyFTS.data import Enrollments
enrollments = Enrollments.get_data()
Exploring the partitioning effects on original data¶
In [8]:
tmp = bchmk.simpleSearch_RMSE(enrollments, enrollments, hofts.HighOrderFTS, range(1,20), [1, 2, 3], tam=[10, 5])
Exploring the partitioning effects on transformed data¶
In [0]:
tmp = bchmk.simpleSearch_RMSE(enrollments, enrollments, hofts.HighOrderFTS, range(1,20), [1, 2, 3],
transformation=tdiff, tam=[10, 5])
Comparing the partitioning schemas¶
In [9]:
from pyFTS.partitioners import Grid, Util as pUtil
fuzzy_sets = Grid.GridPartitioner(data=enrollments, npart=12)
fuzzy_sets2 = Grid.GridPartitioner(data=enrollments, npart=5, transformation=tdiff)
pUtil.plot_partitioners(enrollments, [fuzzy_sets,fuzzy_sets2])
Fitting a model on original data¶
In [11]:
model1 = hofts.HighOrderFTS(partitioner=fuzzy_sets)
model1.fit(enrollments, order=3)
print(model1)
Fitting a model on transformed data¶
In [0]:
model2 = hofts.HighOrderFTS("FTS Diff", partitioner=fuzzy_sets2)
model2.append_transformation(tdiff)
model2.fit(enrollments, order=3)
print(model2)
Using the models¶
In [0]:
model1.predict(enrollments)
Out[0]:
In [0]:
model2.predict(enrollments)
Out[0]:
Comparing the models¶
In [0]:
bchmk.plot_compared_series(enrollments, [model1, model2], bchmk.colors, intervals=False)
In [0]:
bchmk.print_point_statistics(enrollments, [model1, model2])
Residual Analysis¶
In [0]:
from pyFTS.benchmarks import ResidualAnalysis as ra
ra.plot_residuals(enrollments, [model1, model2])
In [0]:
In [0]: