- Deep refactor on project folders

This commit is contained in:
Petrônio Cândido 2018-02-26 13:29:11 -03:00
parent 6e4df0ce33
commit e4838693a6
44 changed files with 75 additions and 130 deletions

View File

@ -5,8 +5,7 @@ import numpy as np
import pandas as pd
from statsmodels.tsa.arima_model import ARIMA as stats_arima
import scipy.stats as st
from pyFTS import fts
from pyFTS.common import SortedCollection
from pyFTS.common import SortedCollection, fts
from pyFTS.probabilistic import ProbabilityDistribution

View File

@ -13,14 +13,14 @@ import matplotlib.cm as cmx
import matplotlib.colors as pltcolors
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
#from mpl_toolkits.mplot3d import Axes3D
from pyFTS.probabilistic import ProbabilityDistribution
from pyFTS import song, chen, yu, ismailefendi, sadaei, hofts, pwfts, ifts, cheng, ensemble, hwang
from pyFTS.models import song, chen, yu, ismailefendi, sadaei, hofts, pwfts, ifts, cheng, hwang
from pyFTS.models.ensemble import ensemble
from pyFTS.benchmarks import Measures, naive, arima, ResidualAnalysis, quantreg
from pyFTS.benchmarks import Util as bUtil
from pyFTS.common import Transformations, Util
from pyFTS.common import Util
# from sklearn.cross_validation import KFold
from pyFTS.partitioners import Grid
from matplotlib import rc
@ -817,7 +817,6 @@ def plot_compared_intervals_ahead(original, models, colors, distributions, time_
def plot_density_rectange(ax, cmap, density, fig, resolution, time_from, time_to):
from matplotlib.patches import Rectangle
from matplotlib.collections import PatchCollection
from matplotlib.colorbar import ColorbarPatch
patches = []
colors = []
for x in density.index:
@ -840,7 +839,6 @@ from pyFTS.common import Transformations
def plot_probabilitydistribution_density(ax, cmap, probabilitydist, fig, time_from):
from matplotlib.patches import Rectangle
from matplotlib.collections import PatchCollection
from matplotlib.colorbar import ColorbarPatch
patches = []
colors = []
for ct, dt in enumerate(probabilitydist):

View File

@ -8,13 +8,12 @@ python3 /usr/local/bin/dispynode.py -i [local IP] -d
import datetime
import time
from copy import deepcopy
import dispy
import dispy.httpd
import numpy as np
from pyFTS.benchmarks import benchmarks, Util as bUtil, naive, quantreg, arima
from pyFTS.benchmarks import benchmarks, Util as bUtil, quantreg, arima
from pyFTS.common import Util
from pyFTS.partitioners import Grid
@ -32,7 +31,8 @@ def run_point(mfts, partitioner, train_data, test_data, window_key=None, transfo
:return: a dictionary with the benchmark results
"""
import time
from pyFTS import yu,chen,hofts,ifts,pwfts,ismailefendi,sadaei, song, cheng, hwang
from pyFTS import yu, hofts, pwfts,ismailefendi,sadaei, song, cheng, hwang
from pyFTS.models import chen
from pyFTS.partitioners import Grid, Entropy, FCM
from pyFTS.benchmarks import Measures, naive, arima, quantreg
from pyFTS.common import Transformations
@ -424,9 +424,10 @@ def run_ahead(mfts, partitioner, train_data, test_data, steps, resolution, windo
"""
import time
import numpy as np
from pyFTS import hofts, ifts, pwfts, ensemble
from pyFTS import hofts, ifts, pwfts
from pyFTS.models import ensemble
from pyFTS.partitioners import Grid, Entropy, FCM
from pyFTS.benchmarks import Measures, arima, quantreg
from pyFTS.benchmarks import Measures, arima
from pyFTS.models.seasonal import SeasonalIndexer
tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, pwfts.ProbabilisticWeightedFTS, arima.ARIMA, ensemble.AllMethodEnsembleFTS]

View File

@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf8 -*-
from pyFTS import fts
from pyFTS.common import fts
class Naive(fts.FTS):

View File

@ -5,8 +5,7 @@ import numpy as np
import pandas as pd
from statsmodels.regression.quantile_regression import QuantReg
from statsmodels.tsa.tsatools import lagmat
from pyFTS import fts
from pyFTS.common import SortedCollection
from pyFTS.common import SortedCollection, fts
from pyFTS.probabilistic import ProbabilityDistribution
class QuantileRegression(fts.FTS):

View File

@ -5,8 +5,7 @@ S.-M. Chen, “Forecasting enrollments based on fuzzy time series,” Fuzzy Sets
"""
import numpy as np
from pyFTS.common import FuzzySet, FLR
from pyFTS import fts,flrg
from pyFTS.common import FuzzySet, FLR, fts, flrg
class ConventionalFLRG(flrg.FLRG):

View File

@ -6,8 +6,8 @@ Expert Syst. Appl., vol. 36, no. 2, pp. 18261832, 2009.
"""
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import fts, yu
from pyFTS.common import FuzzySet, FLR, fts
from pyFTS.models import yu
class TrendWeightedFLRG(yu.WeightedFLRG):

View File

@ -3,16 +3,10 @@
import numpy as np
import pandas as pd
import math
from operator import itemgetter
from pyFTS.common import FLR, FuzzySet, SortedCollection
from pyFTS import fts, chen, cheng, hofts, hwang, ismailefendi, sadaei, song, yu
from pyFTS.benchmarks import arima, quantreg
from pyFTS.common import Transformations
from pyFTS.common import SortedCollection, fts, tree
from pyFTS.models import chen, cheng, hofts, hwang, ismailefendi, sadaei, song, yu
import scipy.stats as st
from pyFTS import tree
from pyFTS.seasonal import sfts, msfts
from pyFTS.probabilistic import ProbabilityDistribution, kde
def sampler(data, quantiles):
ret = []
@ -239,7 +233,7 @@ class AllMethodEnsembleFTS(EnsembleFTS):
self.original_min = min(data)
fo_methods = [song.ConventionalFTS, chen.ConventionalFTS, yu.WeightedFTS, cheng.TrendWeightedFTS,
sadaei.ExponentialyWeightedFTS, ismailefendi.ImprovedWeightedFTS]
sadaei.ExponentialyWeightedFTS, ismailefendi.ImprovedWeightedFTS]
ho_methods = [hofts.HighOrderFTS, hwang.HighOrderFTS]

View File

@ -2,17 +2,10 @@
# -*- coding: utf8 -*-
import numpy as np
import pandas as pd
import math
from operator import itemgetter
from pyFTS.common import FLR, FuzzySet, SortedCollection
from pyFTS import fts, chen, cheng, hofts, hwang, ismailefendi, sadaei, song, yu, sfts
from pyFTS.benchmarks import arima, quantreg
from pyFTS.common import Transformations, Util as cUtil
import scipy.stats as st
from pyFTS.ensemble import ensemble
from pyFTS.models import msfts, cmsfts
from pyFTS.probabilistic import ProbabilityDistribution, kde
from pyFTS.common import Util as cUtil
from pyFTS.models.ensemble import ensemble
from pyFTS.models.seasonal import cmsfts
from pyFTS.probabilistic import ProbabilityDistribution
from copy import deepcopy
from joblib import Parallel, delayed
import multiprocessing

View File

@ -6,9 +6,7 @@ Fuzzy Sets Syst., vol. 81, no. 3, pp. 311319, 1996.
"""
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import fts, flrg, tree
from pyFTS.common import FuzzySet, FLR, fts, flrg, tree
class HighOrderFLRG(flrg.FLRG):
"""Conventional High Order Fuzzy Logical Relationship Group"""

View File

@ -6,8 +6,7 @@ Fuzzy Sets Syst., no. 100, pp. 217228, 1998.
"""
import numpy as np
from pyFTS.common import FuzzySet,FLR,Transformations
from pyFTS import fts
from pyFTS.common import FuzzySet, FLR, Transformations, fts
class HighOrderFTS(fts.FTS):

View File

@ -2,8 +2,8 @@
# -*- coding: utf8 -*-
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import hofts, fts, tree
from pyFTS.common import FuzzySet, FLR, fts, tree
from pyFTS.models import hofts
class IntervalFTS(hofts.HighOrderFTS):

View File

@ -6,8 +6,7 @@ US Dollar to Ringgit Malaysia,” Int. J. Comput. Intell. Appl., vol. 12, no. 1,
"""
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import fts, flrg
from pyFTS.common import FuzzySet, FLR, fts, flrg
class ImprovedWeightedFLRG(flrg.FLRG):

View File

@ -9,7 +9,7 @@ import numpy as np
from pyFTS import *
from pyFTS.common import FuzzySet as FS, Membership, FLR
from pyFTS.partitioners import partitioner
from pyFTS.nonstationary import perturbation
from pyFTS.models.nonstationary import perturbation
class FuzzySet(FS.FuzzySet):

View File

@ -1,7 +1,7 @@
import numpy as np
from pyFTS import fts, flrg, chen
from pyFTS.nonstationary import common, perturbation, nsfts
from pyFTS.common import Transformations, FuzzySet, FLR
from pyFTS.models import chen
from pyFTS.models.nonstationary import common,nsfts
from pyFTS.common import FLR
class ConditionalVarianceFTS(chen.ConventionalFTS):

View File

@ -1,6 +1,6 @@
from pyFTS import flrg
from pyFTS.nonstationary import common
from pyFTS.common import flrg
from pyFTS.models.nonstationary import common
class NonStationaryFLRG(flrg.FLRG):

View File

@ -1,8 +1,7 @@
import numpy as np
from pyFTS.common import FuzzySet, FLR
from pyFTS import fts, hofts
from pyFTS.common import FuzzySet, FLR, fts, tree
from pyFTS.models import hofts
from pyFTS.nonstationary import common, flrg
from pyFTS import tree
class HighOrderNonStationaryFLRG(flrg.NonStationaryFLRG):

View File

@ -1,6 +1,5 @@
import numpy as np
from pyFTS.common import FuzzySet, FLR
from pyFTS import fts, chen
from pyFTS.common import FLR, fts
from pyFTS.nonstationary import common, flrg

View File

@ -1,6 +1,6 @@
import numpy as np
from pyFTS.partitioners import partitioner
from pyFTS.nonstationary import common, perturbation
from pyFTS.models.nonstationary import common, perturbation
class PolynomialNonStationaryPartitioner(partitioner.Partitioner):

View File

@ -5,8 +5,8 @@ import numpy as np
import pandas as pd
import math
from operator import itemgetter
from pyFTS.common import FLR, FuzzySet, SortedCollection
from pyFTS import hofts, ifts, tree
from pyFTS.common import FLR, FuzzySet, tree
from pyFTS.models import hofts, ifts
from pyFTS.probabilistic import ProbabilityDistribution

View File

@ -6,8 +6,7 @@ refined exponentially weighted fuzzy time series and an improved harmony search,
"""
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import fts, flrg
from pyFTS.common import FuzzySet,FLR,fts, flrg
class ExponentialyWeightedFLRG(flrg.FLRG):

View File

@ -1,7 +1,6 @@
import numpy as np
import pandas as pd
from enum import Enum
from pyFTS.seasonal import common
from pyFTS.models.seasonal import common
class SeasonalIndexer(object):

View File

@ -1,6 +1,7 @@
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import fts, sfts, chen
from pyFTS.common import FuzzySet, FLR
from pyFTS.models.seasonal import sfts
from pyFTS.models import chen
class ContextualSeasonalFLRG(object):

View File

@ -1,6 +1,6 @@
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS.seasonal import sfts
from pyFTS.common import FLR
from pyFTS.models.seasonal import sfts
class MultiSeasonalFTS(sfts.SeasonalFTS):

View File

@ -7,8 +7,7 @@ S.-M. Chen, “Forecasting enrollments based on fuzzy time series,” Fuzzy Sets
"""
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import fts
from pyFTS.common import FuzzySet, FLR, fts
class SeasonalFLRG(FLR.FLR):

View File

@ -5,8 +5,7 @@ Q. Song and B. S. Chissom, “Fuzzy time series and its models,” Fuzzy Sets Sy
"""
import numpy as np
from pyFTS.common import FuzzySet, FLR
from pyFTS import fts
from pyFTS.common import FuzzySet, FLR, fts
class ConventionalFTS(fts.FTS):

View File

@ -6,8 +6,8 @@ Phys. A Stat. Mech. its Appl., vol. 349, no. 3, pp. 609624, 2005.
"""
import numpy as np
from pyFTS.common import FuzzySet,FLR
from pyFTS import fts, flrg, chen
from pyFTS.common import FuzzySet, FLR, fts, flrg
from pyFTS.models import chen
class WeightedFLRG(flrg.FLRG):

View File

@ -12,8 +12,8 @@ import datetime
import pandas as pd
from pyFTS.partitioners import Grid, CMeans, FCM, Entropy
from pyFTS.common import FLR,FuzzySet,Membership,Transformations,Util
from pyFTS import fts,sfts
from pyFTS.common import FLR, FuzzySet, Membership, Transformations, Util, fts
from pyFTS import sfts
from pyFTS.models import msfts
from pyFTS.benchmarks import benchmarks as bchmk
from pyFTS.benchmarks import Measures

View File

@ -1,13 +1,14 @@
from pyFTS.partitioners import Grid
from pyFTS import fts, flrg, song, chen, yu, sadaei, ismailefendi, cheng, hofts
from pyFTS.models import chen
from pyFTS.benchmarks import Measures
from pyFTS.common import Util as cUtil
from pyFTS.common import Util as cUtil, fts
import pandas as pd
import numpy as np
import os
from pyFTS.common import Transformations
from copy import deepcopy
from pyFTS.nonstationary import common, flrg, util, perturbation, nsfts, honsfts, partitioners
from pyFTS.nonstationary import flrg, util, honsfts, partitioners
from pyFTS.models.nonstationary import nsfts
bc = Transformations.BoxCox(0)
@ -19,10 +20,8 @@ os.chdir("/home/petronio/Dropbox/Doutorado/Codigos/")
def evaluate_individual_model(model, partitioner, train, test, window_size, time_displacement):
import numpy as np
from pyFTS.common import FLR, FuzzySet
from pyFTS.partitioners import Grid
from pyFTS.benchmarks import Measures
from pyFTS.nonstationary import common, flrg, util, perturbation, nsfts, honsfts, partitioners
try:
model.train(train, sets=partitioner.sets, order=model.order, parameters=window_size)

View File

@ -3,20 +3,13 @@
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, Entropy, FCM, Huarng
from pyFTS.common import FLR,FuzzySet,Membership,Transformations
from pyFTS import fts,hofts,ifts,pwfts,tree, chen, song, yu, cheng, ismailefendi, sadaei, hwang
from pyFTS.benchmarks import naive, arima
from numpy import random
from pyFTS.benchmarks import benchmarks as bchmk
from pyFTS.benchmarks import arima, quantreg, Measures
from pyFTS.ensemble import ensemble
from pyFTS.partitioners import Grid
from pyFTS.common import Transformations
from pyFTS import hofts, song, yu, cheng, ismailefendi, sadaei, hwang
from pyFTS.models import chen
from pyFTS.models.ensemble import ensemble
os.chdir("/home/petronio/dados/Dropbox/Doutorado/Codigos/")

View File

@ -3,20 +3,13 @@
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, Entropy, FCM, Huarng
from pyFTS.common import FLR,FuzzySet,Membership,Transformations, Util as cUtil
from pyFTS import fts,hofts,ifts,pwfts,tree, chen
from pyFTS.common import Transformations
#from pyFTS.benchmarks import benchmarks as bchmk
from pyFTS.benchmarks import naive, arima
from pyFTS.benchmarks import Measures
from numpy import random
from pyFTS.seasonal import SeasonalIndexer
os.chdir("/home/petronio/dados/Dropbox/Doutorado/Codigos/")

View File

@ -1,7 +1,8 @@
import os
import numpy as np
from pyFTS.common import Membership, Transformations
from pyFTS.nonstationary import common,perturbation, partitioners, util,nsfts, honsfts, cvfts
from pyFTS.nonstationary import common,perturbation, partitioners, util, honsfts, cvfts
from pyFTS.models.nonstationary import nsfts
from pyFTS.partitioners import Grid
import matplotlib.pyplot as plt
from pyFTS.common import Util as cUtil

View File

@ -9,11 +9,9 @@ import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pandas as pd
from pyFTS.partitioners import Grid
from pyFTS.common import FLR,FuzzySet,Membership,Transformations
from pyFTS import fts,hofts,ifts,pwfts,tree, chen
from pyFTS.common import FLR, FuzzySet, Membership, Transformations, fts
from pyFTS.models import chen
from pyFTS.benchmarks import benchmarks as bchmk
from pyFTS.benchmarks import Measures
from numpy import random
#gauss_treino = random.normal(0,1.0,1600)

View File

@ -3,20 +3,10 @@
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 datetime
import pandas as pd
from pyFTS.partitioners import Grid, CMeans, FCM, Entropy
from pyFTS.common import FLR,FuzzySet,Membership,Transformations,Util
from pyFTS import fts
from pyFTS.seasonal import sfts, msfts
from pyFTS.common import Util
from pyFTS.benchmarks import benchmarks as bchmk
from pyFTS.benchmarks import Measures
os.chdir("/home/petronio/dados/Dropbox/Doutorado/Codigos/")
@ -38,10 +28,6 @@ sonda_teste = sonda[1051201:]
# tam=[15,8], plotforecasts=False,elev=45, azim=40,
# save=False,file="pictures/sonda_sfts_error_surface", intervals=False)
from pyFTS.models.seasonal import SeasonalIndexer
from pyFTS.models import msfts
from pyFTS.common import FLR
partitions = ['grid','entropy']
indexers = ['m15','Mh','Mhm15']

View File

@ -2,11 +2,12 @@ from distutils.core import setup
setup(
name='pyFTS',
packages=['pyFTS', 'pyFTS.benchmarks', 'pyFTS.common', 'pyFTS.data', 'pyFTS.ensemble',
'pyFTS.models', 'pyFTS.seasonal', 'pyFTS.partitioners', 'pyFTS.probabilistic',
'pyFTS.tests', 'pyFTS.nonstationary'],
package_data={'benchmarks': ['*'], 'common': ['*'], 'data': ['*'], 'ensemble': ['*'], 'models': ['*'],
'seasonal': ['*'], 'partitioners': ['*'], 'probabilistic': ['*'], 'tests': ['*']},
packages=['pyFTS', 'pyFTS.benchmarks', 'pyFTS.common', 'pyFTS.data', 'pyFTS.models.ensemble',
'pyFTS.models', 'pyFTS.models.seasonal', 'pyFTS.partitioners', 'pyFTS.probabilistic',
'pyFTS.tests', 'pyFTS.models.nonstationary'],
package_data={'benchmarks': ['*'], 'common': ['*'], 'data': ['*'],
'models': ['*'], 'seasonal': ['*'], 'ensemble': ['*'],
'partitioners': ['*'], 'probabilistic': ['*'], 'tests': ['*']},
version='1.1.1',
description='Fuzzy Time Series for Python',
author='Petronio Candido L. e Silva',