2017-01-14 03:42:00 +04:00
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf8 -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
import numpy as np
|
|
|
|
import pandas as pd
|
|
|
|
import matplotlib as plt
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
from mpl_toolkits.mplot3d import Axes3D
|
|
|
|
|
|
|
|
import pandas as pd
|
|
|
|
from pyFTS.partitioners import Grid
|
2017-01-30 03:59:50 +04:00
|
|
|
from pyFTS.common import FLR,FuzzySet,Membership,Transformations
|
2017-02-22 23:18:15 +04:00
|
|
|
from pyFTS import fts,hofts,ifts,pwfts,tree, chen
|
2017-01-14 03:42:00 +04:00
|
|
|
from pyFTS.benchmarks import benchmarks as bchmk
|
2017-02-01 20:54:37 +04:00
|
|
|
from pyFTS.benchmarks import Measures
|
|
|
|
from numpy import random
|
|
|
|
|
2017-02-16 17:54:37 +04:00
|
|
|
#gauss_treino = random.normal(0,1.0,1600)
|
|
|
|
#gauss_teste = random.normal(0,1.0,400)
|
2017-01-14 03:42:00 +04:00
|
|
|
|
|
|
|
|
2017-05-02 03:56:47 +04:00
|
|
|
os.chdir("/home/petronio/dados/Dropbox/Doutorado/Codigos/")
|
2017-01-14 03:42:00 +04:00
|
|
|
|
2017-05-02 03:56:47 +04:00
|
|
|
enrollments = pd.read_csv("DataSets/Enrollments.csv", sep=";")
|
|
|
|
enrollments = np.array(enrollments["Enrollments"])
|
2017-02-01 20:54:37 +04:00
|
|
|
|
2017-05-02 03:56:47 +04:00
|
|
|
import importlib
|
|
|
|
import pandas as pd
|
|
|
|
from pyFTS.partitioners import Grid
|
|
|
|
from pyFTS.common import FLR, FuzzySet, Membership, SortedCollection
|
|
|
|
from pyFTS import fts
|
|
|
|
from pyFTS import hofts
|
|
|
|
from pyFTS import pwfts
|
|
|
|
from pyFTS import tree
|
|
|
|
from pyFTS.benchmarks import benchmarks as bchmk
|
2017-02-19 08:02:59 +04:00
|
|
|
|
2017-05-02 03:56:47 +04:00
|
|
|
enrollments_fs1 = Grid.GridPartitioner(enrollments, 6).sets
|
|
|
|
for s in enrollments_fs1:
|
|
|
|
print(s)
|
2017-02-16 17:54:37 +04:00
|
|
|
|
2017-05-02 03:56:47 +04:00
|
|
|
pfts1_enrollments = pwfts.ProbabilisticWeightedFTS("1")
|
|
|
|
pfts1_enrollments.train(enrollments, enrollments_fs1, 1)
|
|
|
|
pfts1_enrollments.shortname = "1st Order"
|
|
|
|
pfts2_enrollments = pwfts.ProbabilisticWeightedFTS("2")
|
|
|
|
pfts2_enrollments.dump = False
|
|
|
|
pfts2_enrollments.shortname = "2nd Order"
|
|
|
|
pfts2_enrollments.train(enrollments, enrollments_fs1, 2)
|
|
|
|
pfts3_enrollments = pwfts.ProbabilisticWeightedFTS("3")
|
|
|
|
pfts3_enrollments.dump = False
|
|
|
|
pfts3_enrollments.shortname = "3rd Order"
|
|
|
|
pfts3_enrollments.train(enrollments, enrollments_fs1, 3)
|
2017-02-01 20:54:37 +04:00
|
|
|
|
2017-05-02 03:56:47 +04:00
|
|
|
bchmk.plot_compared_series(enrollments,[pfts1_enrollments,pfts2_enrollments, pfts3_enrollments],
|
|
|
|
["red","blue","green"], linewidth=2,
|
2017-05-03 00:16:49 +04:00
|
|
|
typeonlegend=True,save=False,file="pictures/pwfts_enrollments_interval.png",
|
|
|
|
tam=[20,7],points=False, intervals=True)
|
2017-02-01 20:54:37 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-15 05:01:44 +04:00
|
|
|
|
|
|
|
|
2017-01-14 03:42:00 +04:00
|
|
|
|
|
|
|
|