211 KiB
211 KiB
High Order Interval Fuzzy Time Series¶
SILVA, Petrônio CL; SADAEI, Hossein Javedani; GUIMARÃES, Frederico Gadelha. Interval Forecasting with Fuzzy Time Series. In: Computational Intelligence (SSCI), 2016 IEEE Symposium Series on. IEEE, 2016. p. 1-8.
In [1]:
import matplotlib.pylab as plt
from pyFTS.benchmarks import benchmarks as bchmk
from pyFTS.models import ifts
from pyFTS.common import Transformations
tdiff = Transformations.Differential(1)
%pylab inline
In [2]:
from pyFTS.data import Enrollments
enrollments = Enrollments.get_data()
In [3]:
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])
In [4]:
model1 = ifts.IntervalFTS("FTS", partitioner=fuzzy_sets)
model1.fit(enrollments, order=1)
print(model1)
In [5]:
model2 = ifts.IntervalFTS("FTS", partitioner=fuzzy_sets2)
model2.append_transformation(tdiff)
model2.fit(enrollments, order=1)
print(model1)
In [6]:
bchmk.plot_compared_series(enrollments, [model1, model2], bchmk.colors,
points=False, intervals=True)
In [7]:
bchmk.print_interval_statistics(enrollments, [model1, model2])
In [ ]: