diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 94276f2..f7702c5 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index ae9cb2c..17d8e34 100644 Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ diff --git a/docs/build/doctrees/modules.doctree b/docs/build/doctrees/modules.doctree index 94ec7ae..66f6122 100644 Binary files a/docs/build/doctrees/modules.doctree and b/docs/build/doctrees/modules.doctree differ diff --git a/docs/build/doctrees/pyFTS.benchmarks.doctree b/docs/build/doctrees/pyFTS.benchmarks.doctree index 08ca2ca..ba0c1a9 100644 Binary files a/docs/build/doctrees/pyFTS.benchmarks.doctree and b/docs/build/doctrees/pyFTS.benchmarks.doctree differ diff --git a/docs/build/doctrees/pyFTS.common.doctree b/docs/build/doctrees/pyFTS.common.doctree index 2311015..03fc0d4 100644 Binary files a/docs/build/doctrees/pyFTS.common.doctree and b/docs/build/doctrees/pyFTS.common.doctree differ diff --git a/docs/build/doctrees/pyFTS.common.transformations.doctree b/docs/build/doctrees/pyFTS.common.transformations.doctree index 7684d61..e020ca9 100644 Binary files a/docs/build/doctrees/pyFTS.common.transformations.doctree and b/docs/build/doctrees/pyFTS.common.transformations.doctree differ diff --git a/docs/build/doctrees/pyFTS.data.doctree b/docs/build/doctrees/pyFTS.data.doctree index cedd6ef..15a6793 100644 Binary files a/docs/build/doctrees/pyFTS.data.doctree and b/docs/build/doctrees/pyFTS.data.doctree differ diff --git a/docs/build/doctrees/pyFTS.distributed.doctree b/docs/build/doctrees/pyFTS.distributed.doctree index 4332aa8..ac6bde6 100644 Binary files a/docs/build/doctrees/pyFTS.distributed.doctree and b/docs/build/doctrees/pyFTS.distributed.doctree differ diff --git a/docs/build/doctrees/pyFTS.doctree b/docs/build/doctrees/pyFTS.doctree index 6098971..5b7ee82 100644 Binary files a/docs/build/doctrees/pyFTS.doctree and b/docs/build/doctrees/pyFTS.doctree differ diff --git a/docs/build/doctrees/pyFTS.hyperparam.doctree b/docs/build/doctrees/pyFTS.hyperparam.doctree index 9068219..a392e40 100644 Binary files a/docs/build/doctrees/pyFTS.hyperparam.doctree and b/docs/build/doctrees/pyFTS.hyperparam.doctree differ diff --git a/docs/build/doctrees/pyFTS.models.doctree b/docs/build/doctrees/pyFTS.models.doctree index 519014b..1a77cfa 100644 Binary files a/docs/build/doctrees/pyFTS.models.doctree and b/docs/build/doctrees/pyFTS.models.doctree differ diff --git a/docs/build/doctrees/pyFTS.models.ensemble.doctree b/docs/build/doctrees/pyFTS.models.ensemble.doctree index e6ced6c..899b414 100644 Binary files a/docs/build/doctrees/pyFTS.models.ensemble.doctree and b/docs/build/doctrees/pyFTS.models.ensemble.doctree differ diff --git a/docs/build/doctrees/pyFTS.models.incremental.doctree b/docs/build/doctrees/pyFTS.models.incremental.doctree index fe9e7c3..9bdd592 100644 Binary files a/docs/build/doctrees/pyFTS.models.incremental.doctree and b/docs/build/doctrees/pyFTS.models.incremental.doctree differ diff --git a/docs/build/doctrees/pyFTS.models.multivariate.doctree b/docs/build/doctrees/pyFTS.models.multivariate.doctree index 876794b..a673a23 100644 Binary files a/docs/build/doctrees/pyFTS.models.multivariate.doctree and b/docs/build/doctrees/pyFTS.models.multivariate.doctree differ diff --git a/docs/build/doctrees/pyFTS.models.nonstationary.doctree b/docs/build/doctrees/pyFTS.models.nonstationary.doctree index f67feea..3c6074b 100644 Binary files a/docs/build/doctrees/pyFTS.models.nonstationary.doctree and b/docs/build/doctrees/pyFTS.models.nonstationary.doctree differ diff --git a/docs/build/doctrees/pyFTS.models.seasonal.doctree b/docs/build/doctrees/pyFTS.models.seasonal.doctree index 5983cc9..8df9dbf 100644 Binary files a/docs/build/doctrees/pyFTS.models.seasonal.doctree and b/docs/build/doctrees/pyFTS.models.seasonal.doctree differ diff --git a/docs/build/doctrees/pyFTS.partitioners.doctree b/docs/build/doctrees/pyFTS.partitioners.doctree index c9c845c..0231482 100644 Binary files a/docs/build/doctrees/pyFTS.partitioners.doctree and b/docs/build/doctrees/pyFTS.partitioners.doctree differ diff --git a/docs/build/doctrees/pyFTS.probabilistic.doctree b/docs/build/doctrees/pyFTS.probabilistic.doctree index 3b647e7..1210a71 100644 Binary files a/docs/build/doctrees/pyFTS.probabilistic.doctree and b/docs/build/doctrees/pyFTS.probabilistic.doctree differ diff --git a/docs/build/doctrees/quickstart.doctree b/docs/build/doctrees/quickstart.doctree index ec8ed83..d7e33cb 100644 Binary files a/docs/build/doctrees/quickstart.doctree and b/docs/build/doctrees/quickstart.doctree differ diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index db3a572..f66253b 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: b63d11eac6819505a39e742f563e774b +config: 792c0fe81cc036dc5c5ce8f82ec8126e tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_modules/index.html b/docs/build/html/_modules/index.html index 9aa8180..065925f 100644 --- a/docs/build/html/_modules/index.html +++ b/docs/build/html/_modules/index.html @@ -5,31 +5,19 @@ - - Overview: module code — pyFTS 1.6 documentation - - + + Overview: module code — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -104,7 +92,6 @@
  • pyFTS.data.mackey_glass
  • pyFTS.data.rossler
  • pyFTS.data.sunspots
  • -
  • pyFTS.distributed.dispy
  • pyFTS.hyperparam.Evolutionary
  • pyFTS.hyperparam.GridSearch
  • pyFTS.hyperparam.Util
  • @@ -171,7 +158,7 @@

    Quick search

    @@ -190,13 +177,13 @@
  • modules |
  • - + \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/BSTS.html b/docs/build/html/_modules/pyFTS/benchmarks/BSTS.html index ea190d2..7876f30 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/BSTS.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/BSTS.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.BSTS — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.BSTS — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,15 +49,15 @@ import numpy as np import pandas as pd import scipy.stats as st -from pyFTS.common import SortedCollection, fts -from pyFTS.probabilistic import ProbabilityDistribution +from pyFTS.common import SortedCollection, fts +from pyFTS.probabilistic import ProbabilityDistribution
    [docs]class ARIMA(fts.FTS): """ Façade for statsmodels.tsa.arima_model """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ARIMA, self).__init__(**kwargs) self.name = "BSTS" self.detail = "Bayesian Structural Time Series" @@ -188,7 +176,7 @@

    Quick search

    @@ -207,14 +195,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/Measures.html b/docs/build/html/_modules/pyFTS/benchmarks/Measures.html index 4266854..c86a34f 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/Measures.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/Measures.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.Measures — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.Measures — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,8 +52,8 @@ import time import numpy as np import pandas as pd -from pyFTS.common import FuzzySet, SortedCollection -from pyFTS.probabilistic import ProbabilityDistribution +from pyFTS.common import FuzzySet, SortedCollection +from pyFTS.probabilistic import ProbabilityDistribution
    [docs]def acf(data, k): @@ -86,21 +74,33 @@ return 1 / ((n - k) * sigma) * s
    -
    [docs]def rmse(targets, forecasts): +
    [docs]def rmse(targets, forecasts, order=0, offset=0): """ Root Mean Squared Error - :param targets: - :param forecasts: + :param targets: array of targets + :param forecasts: array of forecasts + :param order: model order + :param offset: forecast offset related to target. :return: """ if isinstance(targets, list): targets = np.array(targets) if isinstance(forecasts, list): forecasts = np.array(forecasts) - return np.sqrt(np.nanmean((targets - forecasts) ** 2))
    + + if offset == 0: + return np.sqrt(np.nanmean((targets[order:] - forecasts[:]) ** 2)) + else: + return np.sqrt(np.nanmean((targets[order+offset:] - forecasts[:-offset]) ** 2))
    +
    [docs]def nmrse(targets, forecasts, order=0, offset=0): + """ Normalized Root Mean Squared Error """ + return rmse(targets, forecasts, order, offset) / (np.max(targets) - np.min(targets)) ## normalizing in targets because on forecasts might explode to inf (when model predict a line)
    + + +
    [docs]def rmse_interval(targets, forecasts): """ Root Mean Squared Error @@ -631,7 +631,7 @@

    Quick search

    @@ -650,14 +650,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/ResidualAnalysis.html b/docs/build/html/_modules/pyFTS/benchmarks/ResidualAnalysis.html index 53b4bb6..867c73c 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/ResidualAnalysis.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/ResidualAnalysis.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.ResidualAnalysis — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.ResidualAnalysis — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,9 +52,9 @@ import pandas as pd import matplotlib as plt import matplotlib.pyplot as plt -from pyFTS.common import Transformations,Util -from pyFTS.benchmarks import Measures -from scipy import stats +from pyFTS.common import Transformations,Util +from pyFTS.benchmarks import Measures +from scipy import stats
    [docs]def residuals(targets, forecasts, order=1): @@ -75,8 +63,8 @@
    [docs]def ljung_box_test(residuals, lags=[1,2,3], alpha=0.5): - from statsmodels.stats.diagnostic import acorr_ljungbox - from scipy.stats import chi2 + from statsmodels.stats.diagnostic import acorr_ljungbox + from scipy.stats import chi2 stat, pval = acorr_ljungbox(residuals, lags=lags) @@ -99,7 +87,7 @@ :param models: :return: a Pandas dataframe with the Box-Ljung statistic for each model """ - from statsmodels.stats.diagnostic import acorr_ljungbox + from statsmodels.stats.diagnostic import acorr_ljungbox rows = [] columns = ["Model","Order","AVG","STD","Box-Ljung","p-value","Result"] for mfts in models: @@ -189,7 +177,7 @@

    Quick search

    @@ -208,14 +196,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/Tests.html b/docs/build/html/_modules/pyFTS/benchmarks/Tests.html index 9871753..04c28f1 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/Tests.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/Tests.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.Tests — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.Tests — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -59,7 +47,7 @@ import numpy as np import pandas as pd -from pyFTS.benchmarks.Measures import acf +from pyFTS.benchmarks.Measures import acf
    [docs]def BoxPierceStatistic(data, h): @@ -159,7 +147,7 @@ :param method: :return: """ - from stac.stac import nonparametric_tests as npt + from stac.stac import nonparametric_tests as npt methods = tests.columns[1:] @@ -204,7 +192,7 @@ :param method: :return: ''' - from stac.stac import nonparametric_tests as npt + from stac.stac import nonparametric_tests as npt if method == 'bonferroni_dunn': comparisons, z_values, p_values, adj_p_values = npt.bonferroni_dunn_test(post_hoc,control_method) @@ -234,7 +222,7 @@

    Quick search

    @@ -253,14 +241,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/Util.html b/docs/build/html/_modules/pyFTS/benchmarks/Util.html index 966cb9c..5971752 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/Util.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/Util.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.Util — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.Util — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -69,8 +57,8 @@ #from mpl_toolkits.mplot3d import Axes3D -from copy import deepcopy -from pyFTS.common import Util +from copy import deepcopy +from pyFTS.common import Util
    [docs]def open_benchmark_db(name): @@ -1387,7 +1375,7 @@

    Quick search

    @@ -1406,14 +1394,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/arima.html b/docs/build/html/_modules/pyFTS/benchmarks/arima.html index 9c8248f..e66360e 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/arima.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/arima.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.arima — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.arima — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,17 +48,17 @@ import numpy as np import pandas as pd -from statsmodels.tsa.arima_model import ARIMA as stats_arima +from statsmodels.tsa.arima_model import ARIMA as stats_arima import scipy.stats as st -from pyFTS.common import SortedCollection, fts -from pyFTS.probabilistic import ProbabilityDistribution +from pyFTS.common import SortedCollection, fts +from pyFTS.probabilistic import ProbabilityDistribution
    [docs]class ARIMA(fts.FTS): """ Façade for statsmodels.tsa.arima_model """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ARIMA, self).__init__(**kwargs) self.name = "ARIMA" self.detail = "Auto Regressive Integrated Moving Average" @@ -288,7 +276,7 @@

    Quick search

    @@ -307,14 +295,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/benchmarks.html b/docs/build/html/_modules/pyFTS/benchmarks/benchmarks.html index 9d3f36e..5488963 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/benchmarks.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/benchmarks.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.benchmarks — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.benchmarks — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,25 +51,25 @@ import datetime import time -from copy import deepcopy +from copy import deepcopy import traceback import matplotlib as plt import matplotlib.pyplot as plt import numpy as np -from mpl_toolkits.mplot3d import Axes3D -from itertools import product +from mpl_toolkits.mplot3d import Axes3D +from itertools import product -from pyFTS.common import Transformations -from pyFTS.models import song, chen, yu, ismailefendi, sadaei, hofts, pwfts, ifts, cheng, hwang -from pyFTS.models.multivariate import mvfts, wmvfts, cmvfts -from pyFTS.models.ensemble import ensemble -from pyFTS.benchmarks import Measures, naive, arima, ResidualAnalysis, quantreg, knn -from pyFTS.benchmarks import Util as bUtil -from pyFTS.common import Util as cUtil +from pyFTS.common.transformations.differential import Differential +from pyFTS.models import song, chen, yu, ismailefendi, sadaei, hofts, pwfts, ifts, cheng, hwang +from pyFTS.models.multivariate import mvfts, wmvfts, cmvfts +from pyFTS.models.ensemble import ensemble +from pyFTS.benchmarks import Measures, naive, arima, ResidualAnalysis, quantreg, knn +from pyFTS.benchmarks import Util as bUtil +from pyFTS.common import Util as cUtil # from sklearn.cross_validation import KFold -from pyFTS.partitioners import Grid +from pyFTS.partitioners import Grid colors = ['grey', 'darkgrey', 'rosybrown', 'maroon', 'red','orange', 'gold', 'yellow', 'olive', 'green', 'darkgreen', 'cyan', 'lightblue','blue', 'darkblue', 'purple', 'darkviolet' ] @@ -139,7 +127,7 @@
    [docs]def multivariate_sliding_window_benchmarks2(data, windowsize, train=0.8, **kwargs): - from pyFTS.models.multivariate import common, variable, mvfts + from pyFTS.models.multivariate import common, variable, mvfts tag = __pop('tag', None, kwargs) dataset = __pop('dataset', None, kwargs) @@ -489,7 +477,7 @@ inc = __pop("inc", 0.1, kwargs) if progress: - from tqdm import tqdm + from tqdm import tqdm _tdata = len(data) / (windowsize * inc) _tasks = (len(partitioners_models) * len(orders) * len(partitions) * len(transformations) * len(steps_ahead)) _tbcmk = len(benchmark_pool)*len(steps_ahead) @@ -597,10 +585,10 @@ :return: a dictionary with the benchmark results """ import time - from pyFTS.models import yu, chen, hofts, pwfts,ismailefendi,sadaei, song, cheng, hwang - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, naive, arima, quantreg - from pyFTS.common import Transformations + from pyFTS.models import yu, chen, hofts, pwfts,ismailefendi,sadaei, song, cheng, hwang + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, naive, arima, quantreg + from pyFTS.common import Transformations tmp = [song.ConventionalFTS, chen.ConventionalFTS, yu.WeightedFTS, ismailefendi.ImprovedWeightedFTS, cheng.TrendWeightedFTS, sadaei.ExponentialyWeightedFTS, hofts.HighOrderFTS, hwang.HighOrderFTS, @@ -612,7 +600,7 @@ tmp3 = [Measures.get_point_statistics] - tmp5 = [Transformations.Differential] + tmp5 = [Differential] indexer = kwargs.get('indexer', None) @@ -661,9 +649,9 @@ :return: a dictionary with the benchmark results """ import time - from pyFTS.models import hofts,ifts,pwfts - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, arima, quantreg + from pyFTS.models import hofts,ifts,pwfts + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, arima, quantreg tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, pwfts.ProbabilisticWeightedFTS] @@ -723,11 +711,11 @@ """ import time import numpy as np - from pyFTS.models import hofts, ifts, pwfts - from pyFTS.models.ensemble import ensemble - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, arima, quantreg, knn - from pyFTS.models.seasonal import SeasonalIndexer + from pyFTS.models import hofts, ifts, pwfts + from pyFTS.models.ensemble import ensemble + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, arima, quantreg, knn + from pyFTS.models.seasonal import SeasonalIndexer tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, pwfts.ProbabilisticWeightedFTS, arima.ARIMA, ensemble.AllMethodEnsembleFTS, knn.KNearestNeighbors] @@ -788,10 +776,10 @@
    [docs]def mv_run_point2(mfts, train_data, test_data, window_key=None, **kwargs): import time - from pyFTS.models import hofts, ifts, pwfts - from pyFTS.models.multivariate import mvfts, wmvfts, granular - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks + from pyFTS.models import hofts, ifts, pwfts + from pyFTS.models.multivariate import mvfts, wmvfts, granular + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, ifts.WeightedIntervalFTS, pwfts.ProbabilisticWeightedFTS] @@ -848,10 +836,10 @@
    [docs]def run_point2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs): import time - from pyFTS.models import yu, chen, hofts, pwfts,ismailefendi,sadaei, song, cheng, hwang - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, naive, arima, quantreg, benchmarks - from pyFTS.common import Transformations + from pyFTS.models import yu, chen, hofts, pwfts,ismailefendi,sadaei, song, cheng, hwang + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, naive, arima, quantreg, benchmarks + from pyFTS.common import Transformations tmp = [song.ConventionalFTS, chen.ConventionalFTS, yu.WeightedFTS, ismailefendi.ImprovedWeightedFTS, cheng.TrendWeightedFTS, sadaei.ExponentialyWeightedFTS, hofts.HighOrderFTS, hwang.HighOrderFTS, @@ -863,7 +851,7 @@ tmp3 = [Measures.get_point_statistics] - tmp5 = [Transformations.Differential] + tmp5 = [Differential] indexer = kwargs.get('indexer', None) @@ -915,10 +903,10 @@
    [docs]def mv_run_interval2(mfts,train_data, test_data, window_key=None, **kwargs): import time - from pyFTS.models import hofts,ifts,pwfts - from pyFTS.models.multivariate import mvfts, wmvfts, granular - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks + from pyFTS.models import hofts,ifts,pwfts + from pyFTS.models.multivariate import mvfts, wmvfts, granular + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, ifts.WeightedIntervalFTS, pwfts.ProbabilisticWeightedFTS] @@ -978,9 +966,9 @@
    [docs]def run_interval2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs): import time - from pyFTS.models import hofts,ifts,pwfts - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks + from pyFTS.models import hofts,ifts,pwfts + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, ifts.WeightedIntervalFTS, pwfts.ProbabilisticWeightedFTS] @@ -1040,10 +1028,10 @@
    [docs]def mv_run_probabilistic2(mfts, train_data, test_data, window_key=None, **kwargs): import time - from pyFTS.models import hofts, ifts, pwfts - from pyFTS.models.multivariate import mvfts, wmvfts, granular - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks + from pyFTS.models import hofts, ifts, pwfts + from pyFTS.models.multivariate import mvfts, wmvfts, granular + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, arima, quantreg, BSTS, benchmarks tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, ifts.WeightedIntervalFTS, pwfts.ProbabilisticWeightedFTS] @@ -1100,11 +1088,11 @@
    [docs]def run_probabilistic2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs): import time import numpy as np - from pyFTS.models import hofts, ifts, pwfts - from pyFTS.models.ensemble import ensemble - from pyFTS.partitioners import Grid, Entropy, FCM - from pyFTS.benchmarks import Measures, arima, quantreg, knn, benchmarks - from pyFTS.models.seasonal import SeasonalIndexer + from pyFTS.models import hofts, ifts, pwfts + from pyFTS.models.ensemble import ensemble + from pyFTS.partitioners import Grid, Entropy, FCM + from pyFTS.benchmarks import Measures, arima, quantreg, knn, benchmarks + from pyFTS.models.seasonal import SeasonalIndexer tmp = [hofts.HighOrderFTS, ifts.IntervalFTS, pwfts.ProbabilisticWeightedFTS, arima.ARIMA, ensemble.AllMethodEnsembleFTS, knn.KNearestNeighbors] @@ -1441,7 +1429,7 @@ ls = "-" else: ls = "--" - tmpmi, tmpma = Util.plot_interval(ax, forecasts, fts.order, label=lbl, typeonlegend=typeonlegend, + tmpmi, tmpma = cUtil.plot_interval(ax, forecasts, fts.order, label=lbl, typeonlegend=typeonlegend, color=colors[count], ls=ls, linewidth=linewidth) mi.append(tmpmi) ma.append(tmpma) @@ -1476,89 +1464,6 @@ ax.set_ylim([min(original), max(original)])
    -
    [docs]def SelecaoSimples_MenorRMSE(original, parameters, modelo): - ret = [] - errors = [] - forecasted_best = [] - print("Série Original") - fig = plt.figure(figsize=[20, 12]) - fig.suptitle("Comparação de modelos ") - ax0 = fig.add_axes([0, 0.5, 0.65, 0.45]) # left, bottom, width, height - ax0.set_xlim([0, len(original)]) - ax0.set_ylim([min(original), max(original)]) - ax0.set_title('Série Temporal') - ax0.set_ylabel('F(T)') - ax0.set_xlabel('T') - ax0.plot(original, label="Original") - min_rmse = 100000.0 - best = None - for p in parameters: - sets = Grid.GridPartitioner(data=original, npart=p).sets - fts = modelo(str(p) + " particoes") - fts.train(original, sets=sets) - # print(original) - forecasted = fts.forecast(original) - forecasted.insert(0, original[0]) - # print(forecasted) - ax0.plot(forecasted, label=fts.name) - error = Measures.rmse(np.array(forecasted), np.array(original)) - print(p, error) - errors.append(error) - if error < min_rmse: - min_rmse = error - best = fts - forecasted_best = forecasted - handles0, labels0 = ax0.get_legend_handles_labels() - ax0.legend(handles0, labels0) - ax1 = fig.add_axes([0.7, 0.5, 0.3, 0.45]) # left, bottom, width, height - ax1.set_title('Comparação dos Erros Quadráticos Médios') - ax1.set_ylabel('RMSE') - ax1.set_xlabel('Quantidade de Partições') - ax1.set_xlim([min(parameters), max(parameters)]) - ax1.plot(parameters, errors) - ret.append(best) - ret.append(forecasted_best) - # Modelo diferencial - print("\nSérie Diferencial") - difffts = Transformations.differential(original) - errors = [] - forecastedd_best = [] - ax2 = fig.add_axes([0, 0, 0.65, 0.45]) # left, bottom, width, height - ax2.set_xlim([0, len(difffts)]) - ax2.set_ylim([min(difffts), max(difffts)]) - ax2.set_title('Série Temporal') - ax2.set_ylabel('F(T)') - ax2.set_xlabel('T') - ax2.plot(difffts, label="Original") - min_rmse = 100000.0 - bestd = None - for p in parameters: - sets = Grid.GridPartitioner(data=difffts, npart=p) - fts = modelo(str(p) + " particoes") - fts.train(difffts, sets=sets) - forecasted = fts.forecast(difffts) - forecasted.insert(0, difffts[0]) - ax2.plot(forecasted, label=fts.name) - error = Measures.rmse(np.array(forecasted), np.array(difffts)) - print(p, error) - errors.append(error) - if error < min_rmse: - min_rmse = error - bestd = fts - forecastedd_best = forecasted - handles0, labels0 = ax2.get_legend_handles_labels() - ax2.legend(handles0, labels0) - ax3 = fig.add_axes([0.7, 0, 0.3, 0.45]) # left, bottom, width, height - ax3.set_title('Comparação dos Erros Quadráticos Médios') - ax3.set_ylabel('RMSE') - ax3.set_xlabel('Quantidade de Partições') - ax3.set_xlim([min(parameters), max(parameters)]) - ax3.plot(parameters, errors) - ret.append(bestd) - ret.append(forecastedd_best) - return ret
    - -
    [docs]def compareModelsPlot(original, models_fo, models_ho): fig = plt.figure(figsize=[13, 6]) fig.suptitle("Comparação de modelos ") @@ -1878,7 +1783,7 @@

    Quick search

    @@ -1897,14 +1802,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/knn.html b/docs/build/html/_modules/pyFTS/benchmarks/knn.html index 73b1cd9..5cda490 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/knn.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/knn.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.knn — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.knn — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -59,18 +47,18 @@ # -*- coding: utf8 -*- import numpy as np -from statsmodels.tsa.tsatools import lagmat -from pyFTS.common import fts -from pyFTS.probabilistic import ProbabilityDistribution -from sklearn.neighbors import KDTree -from itertools import product -from pyFTS.models.ensemble.ensemble import sampler +from statsmodels.tsa.tsatools import lagmat +from pyFTS.common import fts +from pyFTS.probabilistic import ProbabilityDistribution +from sklearn.neighbors import KDTree +from itertools import product +from pyFTS.models.ensemble.ensemble import sampler
    [docs]class KNearestNeighbors(fts.FTS): """ A façade for sklearn.neighbors """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(KNearestNeighbors, self).__init__(**kwargs) self.name = "kNN" self.shortname = "kNN" @@ -242,7 +230,7 @@

    Quick search

    @@ -261,14 +249,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/naive.html b/docs/build/html/_modules/pyFTS/benchmarks/naive.html index 0547925..1cf87b4 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/naive.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/naive.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.naive — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.naive — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -58,12 +46,12 @@ #!/usr/bin/python # -*- coding: utf8 -*- -from pyFTS.common import fts +from pyFTS.common import fts
    [docs]class Naive(fts.FTS): """Naïve Forecasting method""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(Naive, self).__init__(order=1, name="Naive",**kwargs) self.name = "Naïve Model" self.detail = "Naïve Model" @@ -86,7 +74,7 @@

    Quick search

    @@ -105,14 +93,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/benchmarks/quantreg.html b/docs/build/html/_modules/pyFTS/benchmarks/quantreg.html index f50902a..a41f511 100644 --- a/docs/build/html/_modules/pyFTS/benchmarks/quantreg.html +++ b/docs/build/html/_modules/pyFTS/benchmarks/quantreg.html @@ -5,31 +5,19 @@ - - pyFTS.benchmarks.quantreg — pyFTS 1.6 documentation - - + + pyFTS.benchmarks.quantreg — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,15 +48,15 @@ import numpy as np import pandas as pd -from statsmodels.regression.quantile_regression import QuantReg -from statsmodels.tsa.tsatools import lagmat -from pyFTS.common import SortedCollection, fts -from pyFTS.probabilistic import ProbabilityDistribution +from statsmodels.regression.quantile_regression import QuantReg +from statsmodels.tsa.tsatools import lagmat +from pyFTS.common import SortedCollection, fts +from pyFTS.probabilistic import ProbabilityDistribution
    [docs]class QuantileRegression(fts.FTS): """Façade for statsmodels.regression.quantile_regression""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(QuantileRegression, self).__init__(**kwargs) self.name = "QAR" self.detail = "Quantile Regression" @@ -235,7 +223,7 @@

    Quick search

    @@ -254,14 +242,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/Composite.html b/docs/build/html/_modules/pyFTS/common/Composite.html index a27fea1..26c98ab 100644 --- a/docs/build/html/_modules/pyFTS/common/Composite.html +++ b/docs/build/html/_modules/pyFTS/common/Composite.html @@ -5,31 +5,19 @@ - - pyFTS.common.Composite — pyFTS 1.6 documentation - - + + pyFTS.common.Composite — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,15 +48,15 @@ """ import numpy as np -from pyFTS import * -from pyFTS.common import Membership, FuzzySet +from pyFTS import * +from pyFTS.common import Membership, FuzzySet
    [docs]class FuzzySet(FuzzySet.FuzzySet): """ Composite Fuzzy Set """ - def __init__(self, name, superset=False, **kwargs): + def __init__(self, name, superset=False, **kwargs): """ Create an empty composite fuzzy set :param name: fuzzy set name @@ -134,7 +122,7 @@ self.centroid = set.centroid
    - def __str__(self): + def __str__(self): tmp = str([str(k) for k in self.sets]) return "{}: {}".format(self.name, tmp)
    @@ -151,7 +139,7 @@

    Quick search

    @@ -170,14 +158,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/FLR.html b/docs/build/html/_modules/pyFTS/common/FLR.html index 4c497b7..6c8e698 100644 --- a/docs/build/html/_modules/pyFTS/common/FLR.html +++ b/docs/build/html/_modules/pyFTS/common/FLR.html @@ -5,31 +5,19 @@ - - pyFTS.common.FLR — pyFTS 1.6 documentation - - + + pyFTS.common.FLR — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,7 +48,7 @@ """ import numpy as np -from pyFTS.common import FuzzySet +from pyFTS.common import FuzzySet
    [docs]class FLR(object): @@ -69,7 +57,7 @@ Represents a temporal transition of the fuzzy set LHS on time t for the fuzzy set RHS on time t+1. """ - def __init__(self, LHS, RHS): + def __init__(self, LHS, RHS): """ Creates a Fuzzy Logical Relationship """ @@ -78,13 +66,13 @@ self.RHS = RHS """Right Hand Side fuzzy set""" - def __str__(self): + def __str__(self): return str(self.LHS) + " -> " + str(self.RHS)
    [docs]class IndexedFLR(FLR): """Season Indexed Fuzzy Logical Relationship""" - def __init__(self, index, LHS, RHS): + def __init__(self, index, LHS, RHS): """ Create a Season Indexed Fuzzy Logical Relationship """ @@ -92,7 +80,7 @@ self.index = index """seasonal index""" - def __str__(self): + def __str__(self): return str(self.index) + ": "+ str(self.LHS) + " -> " + str(self.RHS)
    @@ -187,7 +175,7 @@

    Quick search

    @@ -206,14 +194,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/FuzzySet.html b/docs/build/html/_modules/pyFTS/common/FuzzySet.html index 9d081f8..440365c 100644 --- a/docs/build/html/_modules/pyFTS/common/FuzzySet.html +++ b/docs/build/html/_modules/pyFTS/common/FuzzySet.html @@ -5,31 +5,19 @@ - - pyFTS.common.FuzzySet — pyFTS 1.6 documentation - - + + pyFTS.common.FuzzySet — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,8 +44,8 @@

    Source code for pyFTS.common.FuzzySet

     import numpy as np
    -from pyFTS import *
    -from pyFTS.common import Membership
    +from pyFTS import *
    +from pyFTS.common import Membership
     
     
     
    [docs]class FuzzySet(object): @@ -65,21 +53,21 @@ Fuzzy Set """ - def __init__(self, name, mf, parameters, centroid, alpha=1.0, **kwargs): + def __init__(self, name : str, mf, parameters : list, centroid : float, alpha : float=1.0, **kwargs): """ Create a Fuzzy Set """ - self.name = name + self.name : str = name """The fuzzy set name""" - self.mf = mf + self.mf = mf """The membership function""" - self.parameters = parameters + self.parameters : list = parameters """The parameters of the membership function""" - self.centroid = centroid + self.centroid : float = centroid """The fuzzy set center of mass (or midpoint)""" - self.alpha = alpha + self.alpha : float = alpha """The alpha cut value""" - self.type = kwargs.get('type', 'common') + self.type : str = kwargs.get('type', 'common') """The fuzzy set type (common, composite, nonstationary, etc)""" self.variable = kwargs.get('variable', None) """In multivariate time series, indicate for which variable this fuzzy set belogs""" @@ -134,7 +122,7 @@ return self.Z
    - def __str__(self): + def __str__(self): return self.name + ": " + str(self.mf.__name__) + "(" + str(self.parameters) + ")"
    @@ -227,7 +215,7 @@ return [k.name for k in sorted(tmp1, key=lambda x: x.centroid)]
    -
    [docs]def fuzzyfy_instance(inst, fuzzy_sets, ordered_sets=None): +
    [docs]def fuzzyfy_instance(inst, fuzzy_sets : dict , ordered_sets : list =None): """ Calculate the membership values for a data point given fuzzy sets @@ -248,7 +236,7 @@ return mv
    -
    [docs]def fuzzyfy_instances(data, fuzzy_sets, ordered_sets=None): +
    [docs]def fuzzyfy_instances(data : list, fuzzy_sets : dict, ordered_sets=None) -> list: """ Calculate the membership values for a data point given fuzzy sets @@ -266,7 +254,7 @@ return ret
    -
    [docs]def get_fuzzysets(inst, fuzzy_sets, ordered_sets=None, alpha_cut=0.0): +
    [docs]def get_fuzzysets(inst, fuzzy_sets : dict, ordered_sets : list =None, alpha_cut : float =0.0) -> list: """ Return the fuzzy sets which membership value for a inst is greater than the alpha_cut @@ -289,7 +277,7 @@ raise ex
    -
    [docs]def get_maximum_membership_fuzzyset(inst, fuzzy_sets, ordered_sets=None): +
    [docs]def get_maximum_membership_fuzzyset(inst, fuzzy_sets, ordered_sets=None) -> FuzzySet: """ Fuzzify a data point, returning the fuzzy set with maximum membership value @@ -305,7 +293,7 @@ return fuzzy_sets[key]
    -
    [docs]def get_maximum_membership_fuzzyset_index(inst, fuzzy_sets): +
    [docs]def get_maximum_membership_fuzzyset_index(inst, fuzzy_sets) -> int: """ Fuzzify a data point, returning the fuzzy set with maximum membership value @@ -377,7 +365,7 @@

    Quick search

    @@ -396,14 +384,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/Membership.html b/docs/build/html/_modules/pyFTS/common/Membership.html index f9dc69d..b14367f 100644 --- a/docs/build/html/_modules/pyFTS/common/Membership.html +++ b/docs/build/html/_modules/pyFTS/common/Membership.html @@ -5,31 +5,19 @@ - - pyFTS.common.Membership — pyFTS 1.6 documentation - - + + pyFTS.common.Membership — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,7 +49,7 @@ import numpy as np import math -from pyFTS import * +from pyFTS import *
    [docs]def trimf(x, parameters): @@ -161,7 +149,7 @@

    Quick search

    @@ -180,14 +168,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/SortedCollection.html b/docs/build/html/_modules/pyFTS/common/SortedCollection.html index 9bcff75..4ad350f 100644 --- a/docs/build/html/_modules/pyFTS/common/SortedCollection.html +++ b/docs/build/html/_modules/pyFTS/common/SortedCollection.html @@ -5,31 +5,19 @@ - - pyFTS.common.SortedCollection — pyFTS 1.6 documentation - - + + pyFTS.common.SortedCollection — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,7 +43,7 @@

    Source code for pyFTS.common.SortedCollection

    -from bisect import bisect_left, bisect_right
    +from bisect import bisect_left, bisect_right
     
     #
     # Original Source Code: https://code.activestate.com/recipes/577197-sortedcollection/
    @@ -131,7 +119,7 @@
     
         '''
     
    -    def __init__(self, iterable=(), key=None):
    +    def __init__(self, iterable=(), key=None):
             self._given_key = key
             key = (lambda x: x) if key is None else key
             decorated = sorted((key(item), item) for item in iterable)
    @@ -157,19 +145,19 @@
     
    [docs] def copy(self): return self.__class__(self, self._key)
    - def __len__(self): + def __len__(self): return len(self._items) - def __getitem__(self, i): + def __getitem__(self, i): return self._items[i] - def __iter__(self): + def __iter__(self): return iter(self._items) - def __reversed__(self): + def __reversed__(self): return reversed(self._items) - def __repr__(self): + def __repr__(self): return '%s(%r, key=%s)' % ( self.__class__.__name__, self._items, @@ -179,7 +167,7 @@ def __reduce__(self): return self.__class__, (self._items, self._given_key) - def __contains__(self, item): + def __contains__(self, item): k = self._key(item) i = bisect_left(self._keys, k) j = bisect_right(self._keys, k) @@ -294,7 +282,7 @@

    Quick search

    @@ -313,14 +301,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/Util.html b/docs/build/html/_modules/pyFTS/common/Util.html index b6ecb0d..999ea33 100644 --- a/docs/build/html/_modules/pyFTS/common/Util.html +++ b/docs/build/html/_modules/pyFTS/common/Util.html @@ -5,31 +5,19 @@ - - pyFTS.common.Util — pyFTS 1.6 documentation - - + + pyFTS.common.Util — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -65,8 +53,8 @@ import pandas as pd import matplotlib.cm as cmx import matplotlib.colors as pltcolors -from pyFTS.probabilistic import ProbabilityDistribution -from pyFTS.common import Transformations +from pyFTS.probabilistic import ProbabilityDistribution +from pyFTS.common import Transformations
    [docs]def plot_compared_intervals_ahead(original, models, colors, distributions, time_from, time_to, intervals = True, @@ -152,8 +140,8 @@ """ Auxiliar function to plot_compared_intervals_ahead """ - from matplotlib.patches import Rectangle - from matplotlib.collections import PatchCollection + from matplotlib.patches import Rectangle + from matplotlib.collections import PatchCollection patches = [] colors = [] for x in density.index: @@ -193,8 +181,8 @@ :param reference_data: :return: """ - from matplotlib.patches import Rectangle - from matplotlib.collections import PatchCollection + from matplotlib.patches import Rectangle + from matplotlib.collections import PatchCollection patches = [] colors = [] for ct, dt in enumerate(probabilitydist): @@ -550,7 +538,7 @@ rng = np.arange(0,l-windowsize+ic,ic) if progressbar: - from tqdm import tqdm + from tqdm import tqdm rng = tqdm(rng) for count in rng: @@ -620,7 +608,7 @@

    Quick search

    @@ -639,14 +627,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/flrg.html b/docs/build/html/_modules/pyFTS/common/flrg.html index c39e575..50f78f1 100644 --- a/docs/build/html/_modules/pyFTS/common/flrg.html +++ b/docs/build/html/_modules/pyFTS/common/flrg.html @@ -5,31 +5,19 @@ - - pyFTS.common.flrg — pyFTS 1.6 documentation - - + + pyFTS.common.flrg — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -66,7 +54,7 @@ when the LHS pattern is identified on time t. """ - def __init__(self, order, **kwargs): + def __init__(self, order, **kwargs): self.LHS = None """Left Hand Side of the rule""" self.RHS = None @@ -160,7 +148,7 @@ self.upper = max([sets[self.RHS[s]].upper for s in self.RHS.keys()]) return self.upper
    - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs] def reset_calculated_values(self): @@ -181,7 +169,7 @@

    Quick search

    @@ -200,14 +188,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/fts.html b/docs/build/html/_modules/pyFTS/common/fts.html index 6c62349..c4f0efe 100644 --- a/docs/build/html/_modules/pyFTS/common/fts.html +++ b/docs/build/html/_modules/pyFTS/common/fts.html @@ -5,31 +5,19 @@ - - pyFTS.common.fts — pyFTS 1.6 documentation - - + + pyFTS.common.fts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -57,83 +45,86 @@

    Source code for pyFTS.common.fts

     import numpy as np
     import pandas as pd
    -from pyFTS.common import FuzzySet, SortedCollection, tree, Util
    +from pyFTS.common import FuzzySet, Util
    +from pyFTS.common.transformations import transformation
    +from pyFTS.partitioners import partitioner
    +from pyFTS.probabilistic import ProbabilityDistribution
     
     
     
    [docs]class FTS(object): """ Fuzzy Time Series object model """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Create a Fuzzy Time Series model """ - self.flrgs = {} + self.flrgs: dict = {} """The list of Fuzzy Logical Relationship Groups - FLRG""" - self.order = kwargs.get('order',1) + self.order : int = kwargs.get('order',1) """A integer with the model order (number of past lags are used on forecasting)""" - self.shortname = kwargs.get('name',"") + self.shortname : str = kwargs.get('name',"") """A string with a short name or alias for the model""" - self.name = kwargs.get('name',"") + self.name : str = kwargs.get('name',"") """A string with the model name""" - self.detail = kwargs.get('name',"") + self.detail : str = kwargs.get('name',"") """A string with the model detailed information""" - self.is_wrapper = False + self.is_wrapper : bool = False """Indicates that this model is a wrapper for other(s) method(s)""" - self.is_high_order = False + self.is_high_order : bool = False """A boolean value indicating if the model support orders greater than 1, default: False""" - self.min_order = 1 + self.min_order : int = 1 """In high order models, this integer value indicates the minimal order supported for the model, default: 1""" - self.has_seasonality = False + self.has_seasonality : bool = False """A boolean value indicating if the model supports seasonal indexers, default: False""" - self.has_point_forecasting = True + self.has_point_forecasting : bool = True """A boolean value indicating if the model supports point forecasting, default: True""" - self.has_interval_forecasting = False + self.has_interval_forecasting : bool = False """A boolean value indicating if the model supports interval forecasting, default: False""" - self.has_probability_forecasting = False + self.has_probability_forecasting : bool = False """A boolean value indicating if the model support probabilistic forecasting, default: False""" - self.is_multivariate = False + self.is_multivariate : bool = False """A boolean value indicating if the model support multivariate time series (Pandas DataFrame), default: False""" - self.is_clustered = False + self.is_clustered : bool = False """A boolean value indicating if the model support multivariate time series (Pandas DataFrame), but works like a monovariate method, default: False""" - self.dump = False - self.transformations = [] + self.dump : bool = False + self.transformations : list[transformation.Transformation] = [] """A list with the data transformations (common.Transformations) applied on model pre and post processing, default: []""" - self.transformations_param = [] + self.transformations_param : list = [] """A list with the specific parameters for each data transformation""" - self.original_max = 0 + self.original_max : float = 0.0 """A float with the upper limit of the Universe of Discourse, the maximal value found on training data""" - self.original_min = 0 + self.original_min : float = 0.0 """A float with the lower limit of the Universe of Discourse, the minimal value found on training data""" - self.partitioner = kwargs.get("partitioner", None) + self.partitioner : partitioner.Partitioner = kwargs.get("partitioner", None) """A pyFTS.partitioners.Partitioner object with the Universe of Discourse partitioner used on the model. This is a mandatory dependecy. """ if self.partitioner != None: self.sets = self.partitioner.sets - self.auto_update = False + self.auto_update : bool = False """A boolean value indicating that model is incremental""" - self.benchmark_only = False + self.benchmark_only : bool = False """A boolean value indicating a façade for external (non-FTS) model used on benchmarks or ensembles.""" self.indexer = kwargs.get("indexer", None) """An pyFTS.models.seasonal.Indexer object for indexing the time series data""" - self.uod_clip = kwargs.get("uod_clip", True) + self.uod_clip : bool = kwargs.get("uod_clip", True) """Flag indicating if the test data will be clipped inside the training Universe of Discourse""" - self.alpha_cut = kwargs.get("alpha_cut", 0.0) + self.alpha_cut : float = kwargs.get("alpha_cut", 0.0) """A float with the minimal membership to be considered on fuzzyfication process""" - self.lags = kwargs.get("lags", None) + self.lags : list[int] = kwargs.get("lags", None) """The list of lag indexes for high order models""" - self.max_lag = self.order + self.max_lag : int = self.order """A integer indicating the largest lag used by the model. This value also indicates the minimum number of past lags needed to forecast a single step ahead""" - self.log = pd.DataFrame([],columns=["Datetime","Operation","Value"]) + self.log : pd.DataFrame = pd.DataFrame([],columns=["Datetime","Operation","Value"]) """""" - self.is_time_variant = False + self.is_time_variant : bool = False """A boolean value indicating if this model is time variant""" - self.standard_horizon = kwargs.get("standard_horizon", 1) + self.standard_horizon : int = kwargs.get("standard_horizon", 1) """Standard forecasting horizon (Default: 1)""" -
    [docs] def fuzzy(self, data): +
    [docs] def fuzzy(self, data) -> dict: """ Fuzzify a data point @@ -234,7 +225,7 @@ else: if distributed == 'dispy': - from pyFTS.distributed import dispy + from pyFTS.distributed import dispy nodes = kw.pop("nodes", ['127.0.0.1']) num_batches = kw.pop('num_batches', 10) @@ -242,7 +233,7 @@ ret = dispy.distributed_predict(self, kw, nodes, ndata, num_batches, **kw) elif distributed == 'spark': - from pyFTS.distributed import spark + from pyFTS.distributed import spark ret = spark.distributed_predict(data=ndata, model=self, **kw) @@ -255,7 +246,7 @@ return ret
    -
    [docs] def forecast(self, data, **kwargs): +
    [docs] def forecast(self, data, **kwargs) -> list: """ Point forecast one step ahead @@ -265,7 +256,7 @@ """ raise NotImplementedError('This model do not perform one step ahead point forecasts!')
    -
    [docs] def forecast_interval(self, data, **kwargs): +
    [docs] def forecast_interval(self, data, **kwargs) -> list: """ Interval forecast one step ahead @@ -275,7 +266,7 @@ """ raise NotImplementedError('This model do not perform one step ahead interval forecasts!')
    -
    [docs] def forecast_distribution(self, data, **kwargs): +
    [docs] def forecast_distribution(self, data, **kwargs) -> list: """ Probabilistic forecast one step ahead @@ -285,7 +276,7 @@ """ raise NotImplementedError('This model do not perform one step ahead distribution forecasts!')
    -
    [docs] def forecast_multivariate(self, data, **kwargs): +
    [docs] def forecast_multivariate(self, data, **kwargs) -> pd.DataFrame: """ Multivariate forecast one step ahead @@ -296,7 +287,7 @@ raise NotImplementedError('This model do not perform one step ahead multivariate forecasts!')
    -
    [docs] def forecast_ahead(self, data, steps, **kwargs): +
    [docs] def forecast_ahead(self, data, steps, **kwargs) -> list: """ Point forecast from 1 to H steps ahead, where H is given by the steps parameter @@ -326,7 +317,7 @@ return ret[-steps:]
    -
    [docs] def forecast_ahead_interval(self, data, steps, **kwargs): +
    [docs] def forecast_ahead_interval(self, data, steps, **kwargs) -> list: """ Interval forecast from 1 to H steps ahead, where H is given by the steps parameter @@ -337,7 +328,7 @@ """ raise NotImplementedError('This model do not perform multi step ahead interval forecasts!')
    -
    [docs] def forecast_ahead_distribution(self, data, steps, **kwargs): +
    [docs] def forecast_ahead_distribution(self, data, steps, **kwargs) -> list: """ Probabilistic forecast from 1 to H steps ahead, where H is given by the steps parameter @@ -348,7 +339,7 @@ """ raise NotImplementedError('This model do not perform multi step ahead distribution forecasts!')
    -
    [docs] def forecast_ahead_multivariate(self, data, steps, **kwargs): +
    [docs] def forecast_ahead_multivariate(self, data, steps, **kwargs) -> pd.DataFrame: """ Multivariate forecast n step ahead @@ -359,7 +350,7 @@ """ raise NotImplementedError('This model do not perform one step ahead multivariate forecasts!')
    -
    [docs] def forecast_step(self, data, step, **kwargs): +
    [docs] def forecast_step(self, data, step, **kwargs) -> list: """ Point forecast for H steps ahead, where H is given by the step parameter @@ -381,7 +372,7 @@ start = kwargs.get('start_at',0) - for k in np.arange(start+self.max_lag, l): + for k in np.arange(start+self.max_lag, l+1): sample = data[k-self.max_lag:k] tmp = self.forecast_ahead(sample, step, **kwargs) @@ -457,13 +448,13 @@ num_batches = 10 if distributed == 'dispy': - from pyFTS.distributed import dispy + from pyFTS.distributed import dispy nodes = kw.pop('nodes', False) train_method = kwargs.get('train_method', dispy.simple_model_train) dispy.distributed_train(self, train_method, nodes, type(self), data, num_batches, {}, **kw) elif distributed == 'spark': - from pyFTS.distributed import spark + from pyFTS.distributed import spark url = kwargs.get('url', 'spark://127.0.0.1:7077') app = kwargs.get('app', 'pyFTS') @@ -481,7 +472,7 @@ rng = range(self.order, n, batch_size) if dump == 'tqdm': - from tqdm import tqdm + from tqdm import tqdm rng = tqdm(rng) @@ -630,7 +621,7 @@ else: return data
    -
    [docs] def get_UoD(self): +
    [docs] def get_UoD(self) -> set: """ Returns the interval of the known bounds of the universe of discourse (UoD), i. e., the known minimum and maximum values of the time series. @@ -642,7 +633,7 @@ else: return (self.original_min, self.original_max)
    -
    [docs] def offset(self): +
    [docs] def offset(self) -> int: """ Returns the number of lags to skip in the input test data in order to synchronize it with the forecasted values given by the predict function. This is necessary due to the order of the @@ -655,7 +646,7 @@ else: return 1
    - def __str__(self): + def __str__(self): """ String representation of the model @@ -672,7 +663,7 @@ tmp = "{0}{1}\n".format(tmp, str(self.flrgs[r])) return tmp - def __len__(self): + def __len__(self): """ The length (number of rules) of the model @@ -718,7 +709,7 @@

    Quick search

    @@ -737,14 +728,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/common/tree.html b/docs/build/html/_modules/pyFTS/common/tree.html index 407d315..1b47d25 100644 --- a/docs/build/html/_modules/pyFTS/common/tree.html +++ b/docs/build/html/_modules/pyFTS/common/tree.html @@ -5,31 +5,19 @@ - - pyFTS.common.tree — pyFTS 1.6 documentation - - + + pyFTS.common.tree — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -59,8 +47,8 @@ Tree data structure """ -from pyFTS import * -from functools import reduce +from pyFTS import * +from functools import reduce import numpy as np @@ -69,7 +57,7 @@ Tree node for """ - def __init__(self, value): + def __init__(self, value): self.isRoot = False self.children = [] self.value = value @@ -98,13 +86,13 @@ tmp = tmp + "\n" + child.getStr(k + 1) return tmp
    - def __str__(self): + def __str__(self): return self.getStr(0)
    [docs]class FLRGTree: """Represents a FLRG set with a tree structure""" - def __init__(self): + def __init__(self): self.root = FLRGTreeNode(None)
    @@ -140,7 +128,7 @@

    Quick search

    @@ -159,14 +147,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/AirPassengers.html b/docs/build/html/_modules/pyFTS/data/AirPassengers.html index f41548a..83fd631 100644 --- a/docs/build/html/_modules/pyFTS/data/AirPassengers.html +++ b/docs/build/html/_modules/pyFTS/data/AirPassengers.html @@ -5,31 +5,19 @@ - - pyFTS.data.AirPassengers — pyFTS 1.6 documentation - - + + pyFTS.data.AirPassengers — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,12 +49,12 @@ Source: Hyndman, R.J., Time Series Data Library, http://www-personal.buseco.monash.edu.au/~hyndman/TSDL/. """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(): +
    [docs]def get_data() -> np.ndarray: """ Get a simple univariate time series data. @@ -76,7 +64,7 @@ dat = np.array(dat["Passengers"]) return dat
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -99,7 +87,7 @@

    Quick search

    @@ -118,14 +106,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/Bitcoin.html b/docs/build/html/_modules/pyFTS/data/Bitcoin.html index 039b971..6995362 100644 --- a/docs/build/html/_modules/pyFTS/data/Bitcoin.html +++ b/docs/build/html/_modules/pyFTS/data/Bitcoin.html @@ -5,31 +5,19 @@ - - pyFTS.data.Bitcoin — pyFTS 1.6 documentation - - + + pyFTS.data.Bitcoin — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,12 +52,12 @@ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field='AVG'): +
    [docs]def get_data(field:str='AVG') -> np.ndarray: """ Get the univariate time series data. @@ -79,7 +67,8 @@ dat = get_dataframe() return np.array(dat[field])
    -
    [docs]def get_dataframe(): + +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -102,7 +91,7 @@

    Quick search

    @@ -121,14 +110,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/DowJones.html b/docs/build/html/_modules/pyFTS/data/DowJones.html index 788e76a..9e36827 100644 --- a/docs/build/html/_modules/pyFTS/data/DowJones.html +++ b/docs/build/html/_modules/pyFTS/data/DowJones.html @@ -5,31 +5,19 @@ - - pyFTS.data.DowJones — pyFTS 1.6 documentation - - + + pyFTS.data.DowJones — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,12 +52,12 @@ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field='AVG'): +
    [docs]def get_data(field:str='AVG') -> np.ndarray: """ Get the univariate time series data. @@ -80,7 +68,7 @@ return np.array(dat[field])
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -103,7 +91,7 @@

    Quick search

    @@ -122,14 +110,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/EURGBP.html b/docs/build/html/_modules/pyFTS/data/EURGBP.html index efc8ea1..5cd71ee 100644 --- a/docs/build/html/_modules/pyFTS/data/EURGBP.html +++ b/docs/build/html/_modules/pyFTS/data/EURGBP.html @@ -5,31 +5,19 @@ - - pyFTS.data.EURGBP — pyFTS 1.6 documentation - - + + pyFTS.data.EURGBP — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -62,12 +50,12 @@ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field='avg'): +
    [docs]def get_data(field:str='avg') -> np.ndarray: """ Get the univariate time series data. @@ -78,7 +66,7 @@ return np.array(dat[field])
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -101,7 +89,7 @@

    Quick search

    @@ -120,14 +108,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/EURUSD.html b/docs/build/html/_modules/pyFTS/data/EURUSD.html index 34c98f8..0ed6382 100644 --- a/docs/build/html/_modules/pyFTS/data/EURUSD.html +++ b/docs/build/html/_modules/pyFTS/data/EURUSD.html @@ -5,31 +5,19 @@ - - pyFTS.data.EURUSD — pyFTS 1.6 documentation - - + + pyFTS.data.EURUSD — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -62,12 +50,12 @@ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field='avg'): +
    [docs]def get_data(field: str='avg') -> np.ndarray: """ Get the univariate time series data. @@ -78,7 +66,7 @@ return np.array(dat[field])
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -101,7 +89,7 @@

    Quick search

    @@ -120,14 +108,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/Enrollments.html b/docs/build/html/_modules/pyFTS/data/Enrollments.html index 9c9805e..29ee458 100644 --- a/docs/build/html/_modules/pyFTS/data/Enrollments.html +++ b/docs/build/html/_modules/pyFTS/data/Enrollments.html @@ -5,31 +5,19 @@ - - pyFTS.data.Enrollments — pyFTS 1.6 documentation - - + + pyFTS.data.Enrollments — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -59,12 +47,12 @@ Yearly University of Alabama enrollments from 1971 to 1992. """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(): +
    [docs]def get_data() -> np.ndarray: """ Get a simple univariate time series data. @@ -75,7 +63,7 @@ return dat
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: dat = common.get_dataframe('Enrollments.csv', 'https://github.com/petroniocandido/pyFTS/raw/8f20f3634aa6a8f58083bdcd1bbf93795e6ed767/pyFTS/data/Enrollments.csv', sep=";") @@ -92,7 +80,7 @@

    Quick search

    @@ -111,14 +99,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/Ethereum.html b/docs/build/html/_modules/pyFTS/data/Ethereum.html index 34dce24..cd2a0b2 100644 --- a/docs/build/html/_modules/pyFTS/data/Ethereum.html +++ b/docs/build/html/_modules/pyFTS/data/Ethereum.html @@ -5,31 +5,19 @@ - - pyFTS.data.Ethereum — pyFTS 1.6 documentation - - + + pyFTS.data.Ethereum — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,12 +52,12 @@ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field='AVG'): +
    [docs]def get_data(field: str='AVG') -> np.ndarray: """ Get the univariate time series data. @@ -80,7 +68,7 @@ return np.array(dat[field])
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -103,7 +91,7 @@

    Quick search

    @@ -122,14 +110,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/GBPUSD.html b/docs/build/html/_modules/pyFTS/data/GBPUSD.html index e7e65b7..b9fd6bb 100644 --- a/docs/build/html/_modules/pyFTS/data/GBPUSD.html +++ b/docs/build/html/_modules/pyFTS/data/GBPUSD.html @@ -5,31 +5,19 @@ - - pyFTS.data.GBPUSD — pyFTS 1.6 documentation - - + + pyFTS.data.GBPUSD — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -62,12 +50,12 @@ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field='avg'): +
    [docs]def get_data(field: str='avg') -> np.ndarray: """ Get the univariate time series data. @@ -78,7 +66,7 @@ return np.array(dat[field])
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -101,7 +89,7 @@

    Quick search

    @@ -120,14 +108,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/INMET.html b/docs/build/html/_modules/pyFTS/data/INMET.html index 270d0ff..74b21e1 100644 --- a/docs/build/html/_modules/pyFTS/data/INMET.html +++ b/docs/build/html/_modules/pyFTS/data/INMET.html @@ -5,31 +5,19 @@ - - pyFTS.data.INMET — pyFTS 1.6 documentation - - + + pyFTS.data.INMET — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,11 +51,11 @@ Source: http://www.inmet.gov.br """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -90,7 +78,7 @@

    Quick search

    @@ -109,14 +97,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/Malaysia.html b/docs/build/html/_modules/pyFTS/data/Malaysia.html index 883291b..ae09f51 100644 --- a/docs/build/html/_modules/pyFTS/data/Malaysia.html +++ b/docs/build/html/_modules/pyFTS/data/Malaysia.html @@ -5,31 +5,19 @@ - - pyFTS.data.Malaysia — pyFTS 1.6 documentation - - + + pyFTS.data.Malaysia — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,12 +48,12 @@ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field='load'): +
    [docs]def get_data(field: str='load') -> np.ndarray: """ Get the univariate time series data. @@ -76,7 +64,7 @@ return np.array(dat[field])
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -100,7 +88,7 @@

    Quick search

    @@ -119,14 +107,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/NASDAQ.html b/docs/build/html/_modules/pyFTS/data/NASDAQ.html index da8cb12..6430ac2 100644 --- a/docs/build/html/_modules/pyFTS/data/NASDAQ.html +++ b/docs/build/html/_modules/pyFTS/data/NASDAQ.html @@ -5,31 +5,19 @@ - - pyFTS.data.NASDAQ — pyFTS 1.6 documentation - - + + pyFTS.data.NASDAQ — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,12 +51,12 @@ Source: http://www.nasdaq.com/aspx/flashquotes.aspx?symbol=IXIC&selected=IXIC """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field="avg"): +
    [docs]def get_data(field: str="avg") -> np.ndarray: """ Get a simple univariate time series data. @@ -80,7 +68,7 @@ return dat
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -103,7 +91,7 @@

    Quick search

    @@ -122,14 +110,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/SONDA.html b/docs/build/html/_modules/pyFTS/data/SONDA.html index d7402bf..b20bfb9 100644 --- a/docs/build/html/_modules/pyFTS/data/SONDA.html +++ b/docs/build/html/_modules/pyFTS/data/SONDA.html @@ -5,31 +5,19 @@ - - pyFTS.data.SONDA — pyFTS 1.6 documentation - - + + pyFTS.data.SONDA — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,12 +51,12 @@ Source: http://sonda.ccst.inpe.br/ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(field): +
    [docs]def get_data(field:str) -> np.ndarray: """ Get a simple univariate time series data. @@ -80,7 +68,7 @@ return dat
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -104,7 +92,7 @@

    Quick search

    @@ -123,14 +111,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/SP500.html b/docs/build/html/_modules/pyFTS/data/SP500.html index b1e8e27..8d67f4f 100644 --- a/docs/build/html/_modules/pyFTS/data/SP500.html +++ b/docs/build/html/_modules/pyFTS/data/SP500.html @@ -5,31 +5,19 @@ - - pyFTS.data.SP500 — pyFTS 1.6 documentation - - + + pyFTS.data.SP500 — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,12 +51,12 @@ Source: https://finance.yahoo.com/quote/%5EGSPC/history?p=%5EGSPC """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(): +
    [docs]def get_data() -> np.ndarray: """ Get the univariate time series data. @@ -78,7 +66,7 @@ return np.array(dat["Avg"])
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -101,7 +89,7 @@

    Quick search

    @@ -120,14 +108,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/TAIEX.html b/docs/build/html/_modules/pyFTS/data/TAIEX.html index df4656b..e0c9309 100644 --- a/docs/build/html/_modules/pyFTS/data/TAIEX.html +++ b/docs/build/html/_modules/pyFTS/data/TAIEX.html @@ -5,31 +5,19 @@ - - pyFTS.data.TAIEX — pyFTS 1.6 documentation - - + + pyFTS.data.TAIEX — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -62,12 +50,12 @@ Source: http://www.twse.com.tw/en/products/indices/Index_Series.php """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(): +
    [docs]def get_data() -> np.ndarray: """ Get the univariate time series data. @@ -78,7 +66,7 @@ return dat
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -102,7 +90,7 @@

    Quick search

    @@ -121,14 +109,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/artificial.html b/docs/build/html/_modules/pyFTS/data/artificial.html index e085c33..5952ef5 100644 --- a/docs/build/html/_modules/pyFTS/data/artificial.html +++ b/docs/build/html/_modules/pyFTS/data/artificial.html @@ -5,31 +5,19 @@ - - pyFTS.data.artificial — pyFTS 1.6 documentation - - + + pyFTS.data.artificial — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -67,13 +55,13 @@ Emulate a complex signal built from several additive and non-additive components """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(SignalEmulator, self).__init__() self.components = [] """Components of the signal""" -
    [docs] def stationary_gaussian(self, mu, sigma, **kwargs): +
    [docs] def stationary_gaussian(self, mu:float, sigma:float, **kwargs): """ Creates a continuous Gaussian signal with mean mu and variance sigma. @@ -93,7 +81,7 @@ 'parameters': parameters, 'args': kwargs}) return self
    -
    [docs] def incremental_gaussian(self, mu, sigma, **kwargs): +
    [docs] def incremental_gaussian(self, mu:float, sigma:float, **kwargs): """ Creates an additive gaussian interference on a previous signal @@ -111,7 +99,7 @@ 'parameters': parameters, 'args': kwargs}) return self
    -
    [docs] def periodic_gaussian(self, type, period, mu_min, sigma_min, mu_max, sigma_max, **kwargs): +
    [docs] def periodic_gaussian(self, type:str, period:int, mu_min:float, sigma_min:float, mu_max:float, sigma_max:float, **kwargs): """ Creates an additive periodic gaussian interference on a previous signal @@ -407,7 +395,7 @@

    Quick search

    @@ -426,14 +414,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/common.html b/docs/build/html/_modules/pyFTS/data/common.html index 6d2c5b4..15e29e2 100644 --- a/docs/build/html/_modules/pyFTS/data/common.html +++ b/docs/build/html/_modules/pyFTS/data/common.html @@ -5,31 +5,19 @@ - - pyFTS.data.common — pyFTS 1.6 documentation - - + + pyFTS.data.common — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,11 +48,11 @@ import numpy as np import os import pkg_resources -from pathlib import Path -from urllib import request +from pathlib import Path +from urllib import request -
    [docs]def get_dataframe(filename, url, sep=";", compression='infer'): +
    [docs]def get_dataframe(filename: str, url: str, sep:str=";", compression:str='infer') -> pd.DataFrame: """ This method check if filename already exists, read the file and return its data. If the file don't already exists, it will be downloaded and decompressed. @@ -97,7 +85,7 @@

    Quick search

    @@ -116,14 +104,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/henon.html b/docs/build/html/_modules/pyFTS/data/henon.html index ee62d8b..30f3459 100644 --- a/docs/build/html/_modules/pyFTS/data/henon.html +++ b/docs/build/html/_modules/pyFTS/data/henon.html @@ -5,31 +5,19 @@ - - pyFTS.data.henon — pyFTS 1.6 documentation - - + + pyFTS.data.henon — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -66,7 +54,7 @@ import pandas as pd -
    [docs]def get_data(var, a=1.4, b=0.3, initial_values = [1, 1], iterations=1000): +
    [docs]def get_data(var: str, a:float=1.4, b:float=0.3, initial_values: list = [1, 1], iterations:int=1000) -> pd.DataFrame: """ Get a simple univariate time series data. @@ -76,7 +64,7 @@ return get_dataframe(a,b, initial_values, iterations)[var].values
    -
    [docs]def get_dataframe(a=1.4, b=0.3, initial_values = [1, 1], iterations=1000): +
    [docs]def get_dataframe(a:float=1.4, b:float=0.3, initial_values: list = [1, 1], iterations:int=1000) -> pd.DataFrame: ''' Return a dataframe with the bivariate Henon Map time series (x, y). @@ -107,7 +95,7 @@

    Quick search

    @@ -126,14 +114,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/logistic_map.html b/docs/build/html/_modules/pyFTS/data/logistic_map.html index 80313e2..b9eff32 100644 --- a/docs/build/html/_modules/pyFTS/data/logistic_map.html +++ b/docs/build/html/_modules/pyFTS/data/logistic_map.html @@ -5,31 +5,19 @@ - - pyFTS.data.logistic_map — pyFTS 1.6 documentation - - + + pyFTS.data.logistic_map — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -65,7 +53,7 @@ import numpy as np -
    [docs]def get_data(r = 4, initial_value = 0.3, iterations=100): +
    [docs]def get_data(r: float = 4, initial_value: float = 0.3, iterations: int=100) -> list: ''' Return a list with the logistic map chaotic time series. @@ -91,7 +79,7 @@

    Quick search

    @@ -110,14 +98,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/lorentz.html b/docs/build/html/_modules/pyFTS/data/lorentz.html index bda3492..fb4fad4 100644 --- a/docs/build/html/_modules/pyFTS/data/lorentz.html +++ b/docs/build/html/_modules/pyFTS/data/lorentz.html @@ -5,31 +5,19 @@ - - pyFTS.data.lorentz — pyFTS 1.6 documentation - - + + pyFTS.data.lorentz — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -68,8 +56,8 @@ import pandas as pd -
    [docs]def get_data(var, a = 10.0, b = 28.0, c = 8.0 / 3.0, dt = 0.01, - initial_values = [0.1, 0, 0], iterations=1000): +
    [docs]def get_data(var: str, a: float = 10.0, b: float = 28.0, c: float = 8.0 / 3.0, dt: float = 0.01, + initial_values: list = [0.1, 0, 0], iterations: int=1000) -> pd.DataFrame: """ Get a simple univariate time series data. @@ -79,8 +67,8 @@ return get_dataframe(a, b, c, dt, initial_values, iterations)[var].values
    -
    [docs]def get_dataframe(a = 10.0, b = 28.0, c = 8.0 / 3.0, dt = 0.01, - initial_values = [0.1, 0, 0], iterations=1000): +
    [docs]def get_dataframe(a: float = 10.0, b: float = 28.0, c: float = 8.0 / 3.0, dt: float = 0.01, + initial_values: list = [0.1, 0, 0], iterations: int=1000)-> pd.DataFrame: ''' Return a dataframe with the multivariate Lorenz Map time series (x, y, z). @@ -118,7 +106,7 @@

    Quick search

    @@ -137,14 +125,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/mackey_glass.html b/docs/build/html/_modules/pyFTS/data/mackey_glass.html index b381054..cbc32d0 100644 --- a/docs/build/html/_modules/pyFTS/data/mackey_glass.html +++ b/docs/build/html/_modules/pyFTS/data/mackey_glass.html @@ -5,31 +5,19 @@ - - pyFTS.data.mackey_glass — pyFTS 1.6 documentation - - + + pyFTS.data.mackey_glass — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -65,7 +53,7 @@ import numpy as np -
    [docs]def get_data(b=0.1, c=0.2, tau=17, initial_values = np.linspace(0.5,1.5, 18), iterations=1000): +
    [docs]def get_data(b: float=0.1, c: float=0.2, tau: float =17, initial_values: np.ndarray = np.linspace(0.5,1.5, 18), iterations: int=1000) -> list: ''' Return a list with the Mackey-Glass chaotic time series. @@ -94,7 +82,7 @@

    Quick search

    @@ -113,14 +101,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/rossler.html b/docs/build/html/_modules/pyFTS/data/rossler.html index d0b3b8e..4110ebe 100644 --- a/docs/build/html/_modules/pyFTS/data/rossler.html +++ b/docs/build/html/_modules/pyFTS/data/rossler.html @@ -5,31 +5,19 @@ - - pyFTS.data.rossler — pyFTS 1.6 documentation - - + + pyFTS.data.rossler — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -68,8 +56,8 @@ import pandas as pd -
    [docs]def get_data(var, a = 0.2, b = 0.2, c = 5.7, dt = 0.01, - initial_values = [0.001, 0.001, 0.001], iterations=5000): +
    [docs]def get_data(var: str, a: float = 0.2, b: float = 0.2, c: float = 5.7, dt: float = 0.01, + initial_values: np.ndarray = [0.001, 0.001, 0.001], iterations: int=5000) -> np.ndarray: """ Get a simple univariate time series data. @@ -79,8 +67,8 @@ return get_dataframe(a, b, c, dt, initial_values, iterations)[var].values
    -
    [docs]def get_dataframe(a = 0.2, b = 0.2, c = 5.7, dt = 0.01, - initial_values = [0.001, 0.001, 0.001], iterations=5000): +
    [docs]def get_dataframe(a: float = 0.2, b: float = 0.2, c: float = 5.7, dt: float = 0.01, + initial_values: np.ndarray = [0.001, 0.001, 0.001], iterations: int=5000) -> pd.DataFrame: ''' Return a dataframe with the multivariate Rössler Map time series (x, y, z). @@ -118,7 +106,7 @@

    Quick search

    @@ -137,14 +125,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/data/sunspots.html b/docs/build/html/_modules/pyFTS/data/sunspots.html index 5b83b34..2333e72 100644 --- a/docs/build/html/_modules/pyFTS/data/sunspots.html +++ b/docs/build/html/_modules/pyFTS/data/sunspots.html @@ -5,31 +5,19 @@ - - pyFTS.data.sunspots — pyFTS 1.6 documentation - - + + pyFTS.data.sunspots — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,11 +49,11 @@ Source: https://www.esrl.noaa.gov/psd/gcos_wgsp/Timeseries/SUNSPOT/ """ -from pyFTS.data import common +from pyFTS.data import common import pandas as pd import numpy as np -
    [docs]def get_data(): +
    [docs]def get_data() -> np.ndarray: """ Get a simple univariate time series data. @@ -75,7 +63,7 @@ dat = np.array(dat["SUNACTIVITY"]) return dat
    -
    [docs]def get_dataframe(): +
    [docs]def get_dataframe() -> pd.DataFrame: """ Get the complete multivariate time series data. @@ -98,7 +86,7 @@

    Quick search

    @@ -117,14 +105,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/hyperparam/Evolutionary.html b/docs/build/html/_modules/pyFTS/hyperparam/Evolutionary.html index 9b4bc45..e0a53a5 100644 --- a/docs/build/html/_modules/pyFTS/hyperparam/Evolutionary.html +++ b/docs/build/html/_modules/pyFTS/hyperparam/Evolutionary.html @@ -5,31 +5,19 @@ - - pyFTS.hyperparam.Evolutionary — pyFTS 1.6 documentation - - + + pyFTS.hyperparam.Evolutionary — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,16 +51,16 @@ import pandas as pd import math import time -from functools import reduce -from operator import itemgetter +from functools import reduce +from operator import itemgetter import random -from pyFTS.common import Util -from pyFTS.benchmarks import Measures -from pyFTS.partitioners import Grid, Entropy # , Huarng -from pyFTS.common import Membership -from pyFTS.models import hofts, ifts, pwfts -from pyFTS.hyperparam import Util as hUtil +from pyFTS.common import Util +from pyFTS.benchmarks import Measures +from pyFTS.partitioners import Grid, Entropy # , Huarng +from pyFTS.common import Membership +from pyFTS.models import hofts, ifts, pwfts +from pyFTS.hyperparam import Util as hUtil __measures = ['f1', 'f2', 'rmse', 'size'] @@ -144,7 +132,7 @@ :param parameters: dict with model specific arguments for fit method. :return: a fitted FTS model """ - from pyFTS.models import hofts, ifts, pwfts + from pyFTS.models import hofts, ifts, pwfts if individual['mf'] == 1: mf = Membership.trimf @@ -182,10 +170,10 @@ :param parameters: dict with model specific arguments for fit method. :return: a tuple (len_lags, rmse) with the parsimony fitness value and the accuracy fitness value """ - from pyFTS.models import hofts, ifts, pwfts - from pyFTS.common import Util - from pyFTS.benchmarks import Measures - from pyFTS.hyperparam.Evolutionary import phenotype, __measures + from pyFTS.models import hofts, ifts, pwfts + from pyFTS.common import Util + from pyFTS.benchmarks import Measures + from pyFTS.hyperparam.Evolutionary import phenotype, __measures import numpy as np window_size = kwargs.get('window_size', 800) @@ -471,7 +459,7 @@ for key in __measures: individual[key] = ret[key] elif distributed=='dispy': - from pyFTS.distributed import dispy as dUtil + from pyFTS.distributed import dispy as dUtil import dispy jobs = [] for ct, individual in enumerate(population): @@ -660,7 +648,7 @@ shortname = str(fts_method.__module__).split('.')[-1] if distributed == 'dispy': - from pyFTS.distributed import dispy as dUtil + from pyFTS.distributed import dispy as dUtil nodes = kwargs.get('nodes', ['127.0.0.1']) cluster, http_server = dUtil.start_dispy_cluster(evaluate, nodes=nodes) kwargs['cluster'] = cluster @@ -693,7 +681,7 @@

    Quick search

    @@ -712,14 +700,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/hyperparam/GridSearch.html b/docs/build/html/_modules/pyFTS/hyperparam/GridSearch.html index f052f42..462e189 100644 --- a/docs/build/html/_modules/pyFTS/hyperparam/GridSearch.html +++ b/docs/build/html/_modules/pyFTS/hyperparam/GridSearch.html @@ -5,31 +5,19 @@ - - pyFTS.hyperparam.GridSearch — pyFTS 1.6 documentation - - + + pyFTS.hyperparam.GridSearch — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,14 +44,14 @@

    Source code for pyFTS.hyperparam.GridSearch

     
    -from pyFTS.common import Util, Membership
    -from pyFTS.models import hofts
    -from pyFTS.partitioners import Grid, Entropy
    -from pyFTS.benchmarks import Measures
    -from pyFTS.hyperparam import Util as hUtil
    +from pyFTS.common import Util, Membership
    +from pyFTS.models import hofts
    +from pyFTS.partitioners import Grid, Entropy
    +from pyFTS.benchmarks import Measures
    +from pyFTS.hyperparam import Util as hUtil
     
     import numpy as np
    -from itertools import product
    +from itertools import product
     
     
     
    [docs]def dict_individual(mf, partitioner, partitions, order, lags, alpha_cut): @@ -78,10 +66,10 @@
    [docs]def cluster_method(individual, dataset, **kwargs): - from pyFTS.common import Util, Membership - from pyFTS.models import hofts - from pyFTS.partitioners import Grid, Entropy - from pyFTS.benchmarks import Measures + from pyFTS.common import Util, Membership + from pyFTS.models import hofts + from pyFTS.partitioners import Grid, Entropy + from pyFTS.benchmarks import Measures import numpy as np if individual['mf'] == 1: @@ -129,7 +117,7 @@
    [docs]def process_jobs(jobs, datasetname, conn): - from pyFTS.distributed import dispy as dUtil + from pyFTS.distributed import dispy as dUtil import dispy for ct, job in enumerate(jobs): print("Processing job {}".format(ct)) @@ -156,7 +144,7 @@
    [docs]def execute(hyperparams, datasetname, dataset, **kwargs): - from pyFTS.distributed import dispy as dUtil + from pyFTS.distributed import dispy as dUtil import dispy nodes = kwargs.get('nodes',['127.0.0.1']) @@ -240,7 +228,7 @@

    Quick search

    @@ -259,14 +247,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/hyperparam/Util.html b/docs/build/html/_modules/pyFTS/hyperparam/Util.html index da359fc..bb0e9e7 100644 --- a/docs/build/html/_modules/pyFTS/hyperparam/Util.html +++ b/docs/build/html/_modules/pyFTS/hyperparam/Util.html @@ -5,31 +5,19 @@ - - pyFTS.hyperparam.Util — pyFTS 1.6 documentation - - + + pyFTS.hyperparam.Util — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -137,7 +125,7 @@

    Quick search

    @@ -156,14 +144,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/chen.html b/docs/build/html/_modules/pyFTS/models/chen.html index 5bf3e9f..c4ae96c 100644 --- a/docs/build/html/_modules/pyFTS/models/chen.html +++ b/docs/build/html/_modules/pyFTS/models/chen.html @@ -5,31 +5,19 @@ - - pyFTS.models.chen — pyFTS 1.6 documentation - - + + pyFTS.models.chen — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -62,12 +50,12 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts, flrg +from pyFTS.common import FuzzySet, FLR, fts, flrg
    [docs]class ConventionalFLRG(flrg.FLRG): """First Order Conventional Fuzzy Logical Relationship Group""" - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(ConventionalFLRG, self).__init__(1, **kwargs) self.LHS = LHS self.RHS = set() @@ -78,7 +66,7 @@
    [docs] def append_rhs(self, c, **kwargs): self.RHS.add(c)
    - def __str__(self): + def __str__(self): tmp = str(self.LHS) + " -> " tmp2 = "" for c in sorted(self.RHS, key=lambda s: s): @@ -90,7 +78,7 @@
    [docs]class ConventionalFTS(fts.FTS): """Conventional Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ConventionalFTS, self).__init__(order=1, **kwargs) self.name = "Conventional FTS" self.detail = "Chen" @@ -157,7 +145,7 @@

    Quick search

    @@ -176,14 +164,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/cheng.html b/docs/build/html/_modules/pyFTS/models/cheng.html index 3462e63..f684fb1 100644 --- a/docs/build/html/_modules/pyFTS/models/cheng.html +++ b/docs/build/html/_modules/pyFTS/models/cheng.html @@ -5,31 +5,19 @@ - - pyFTS.models.cheng — pyFTS 1.6 documentation - - + + pyFTS.models.cheng — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,15 +51,15 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts -from pyFTS.models import yu +from pyFTS.common import FuzzySet, FLR, fts +from pyFTS.models import yu
    [docs]class TrendWeightedFLRG(yu.WeightedFLRG): """ First Order Trend Weighted Fuzzy Logical Relationship Group """ - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(TrendWeightedFLRG, self).__init__(LHS, **kwargs) self.w = None @@ -102,7 +90,7 @@
    [docs]class TrendWeightedFTS(yu.WeightedFTS): """First Order Trend Weighted Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(TrendWeightedFTS, self).__init__(**kwargs) self.shortname = "TWFTS" self.name = "Trend Weighted FTS" @@ -128,7 +116,7 @@

    Quick search

    @@ -147,14 +135,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/ensemble/ensemble.html b/docs/build/html/_modules/pyFTS/models/ensemble/ensemble.html index 0a424c9..18d2df6 100644 --- a/docs/build/html/_modules/pyFTS/models/ensemble/ensemble.html +++ b/docs/build/html/_modules/pyFTS/models/ensemble/ensemble.html @@ -5,31 +5,19 @@ - - pyFTS.models.ensemble.ensemble — pyFTS 1.6 documentation - - + + pyFTS.models.ensemble.ensemble — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -66,12 +54,12 @@ import numpy as np import pandas as pd -from pyFTS.common import SortedCollection, fts, tree -from pyFTS.models import chen, cheng, hofts, hwang, ismailefendi, sadaei, song, yu -from pyFTS.probabilistic import ProbabilityDistribution -from pyFTS.partitioners import Grid +from pyFTS.common import SortedCollection, fts, tree +from pyFTS.models import chen, cheng, hofts, hwang, ismailefendi, sadaei, song, yu +from pyFTS.probabilistic import ProbabilityDistribution +from pyFTS.partitioners import Grid import scipy.stats as st -from itertools import product +from itertools import product
    [docs]def sampler(data, quantiles, bounds=False): @@ -88,7 +76,7 @@ """ Ensemble FTS """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(EnsembleFTS, self).__init__(**kwargs) self.shortname = "EnsembleFTS" self.name = "Ensemble FTS" @@ -346,7 +334,7 @@ ''' An homogeneous FTS method ensemble with variations on partitionings and orders. ''' - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(SimpleEnsembleFTS, self).__init__(**kwargs) self.method = kwargs.get('fts_method', hofts.WeightedHighOrderFTS) """FTS method class that will be used on internal models""" @@ -376,7 +364,7 @@ """ Creates an EnsembleFTS with all point forecast methods, sharing the same partitioner """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(AllMethodEnsembleFTS, self).__init__(**kwargs) self.min_order = 3 self.shortname ="Ensemble FTS" @@ -421,7 +409,7 @@

    Quick search

    @@ -440,14 +428,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/ensemble/multiseasonal.html b/docs/build/html/_modules/pyFTS/models/ensemble/multiseasonal.html index f378cc9..579b915 100644 --- a/docs/build/html/_modules/pyFTS/models/ensemble/multiseasonal.html +++ b/docs/build/html/_modules/pyFTS/models/ensemble/multiseasonal.html @@ -5,31 +5,19 @@ - - pyFTS.models.ensemble.multiseasonal — pyFTS 1.6 documentation - - + + pyFTS.models.ensemble.multiseasonal — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,12 +49,12 @@ """ import numpy as np -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 +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 @@ -87,7 +75,7 @@
    [docs]class SeasonalEnsembleFTS(ensemble.EnsembleFTS): - def __init__(self, name, **kwargs): + def __init__(self, name, **kwargs): super(SeasonalEnsembleFTS, self).__init__(name="Seasonal Ensemble FTS", **kwargs) self.min_order = 1 self.indexers = [] @@ -160,7 +148,7 @@

    Quick search

    @@ -179,14 +167,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/hofts.html b/docs/build/html/_modules/pyFTS/models/hofts.html index 3612789..4b599ae 100644 --- a/docs/build/html/_modules/pyFTS/models/hofts.html +++ b/docs/build/html/_modules/pyFTS/models/hofts.html @@ -5,31 +5,19 @@ - - pyFTS.models.hofts — pyFTS 1.6 documentation - - + + pyFTS.models.hofts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,13 +51,13 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts, flrg -from itertools import product +from pyFTS.common import FuzzySet, FLR, fts, flrg +from itertools import product
    [docs]class HighOrderFLRG(flrg.FLRG): """Conventional High Order Fuzzy Logical Relationship Group""" - def __init__(self, order, **kwargs): + def __init__(self, order, **kwargs): super(HighOrderFLRG, self).__init__(order, **kwargs) self.LHS = [] self.RHS = {} @@ -86,7 +74,7 @@ else: self.LHS.append(c)
    - def __str__(self): + def __str__(self): tmp = "" for c in sorted(self.RHS): if len(tmp) > 0: @@ -95,14 +83,14 @@ return self.get_key() + " -> " + tmp - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs]class WeightedHighOrderFLRG(flrg.FLRG): """Weighted High Order Fuzzy Logical Relationship Group""" - def __init__(self, order, **kwargs): + def __init__(self, order, **kwargs): super(WeightedHighOrderFLRG, self).__init__(order, **kwargs) self.LHS = [] self.RHS = {} @@ -145,7 +133,7 @@ self.upper = up.dot(self.weights()) return self.upper
    - def __str__(self): + def __str__(self): _str = "" for k in self.RHS.keys(): _str += ", " if len(_str) > 0 else "" @@ -153,13 +141,13 @@ return self.get_key() + " -> " + _str - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs]class HighOrderFTS(fts.FTS): """Conventional High Order Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(HighOrderFTS, self).__init__(**kwargs) self.name = "High Order FTS" self.shortname = "HOFTS" @@ -223,7 +211,7 @@ sample = data[k - self.max_lag: k] - rhs = self.partitioner.fuzzyfy(data[k+_tmp_steps], mode="sets", alpha_cut=self.alpha_cut) + rhs = self.partitioner.fuzzyfy(data[k + _tmp_steps], mode="sets", alpha_cut=self.alpha_cut) flrgs = self.generate_lhs_flrg(sample) @@ -238,12 +226,12 @@
    [docs] def generate_flrg_fuzzyfied(self, data): _tmp_steps = self.standard_horizon - 1 l = len(data) - for k in np.arange(self.max_lag, l): + for k in np.arange(self.max_lag, l - _tmp_steps): if self.dump: print("FLR: " + str(k)) sample = data[k - self.max_lag: k] - rhs = data[k+_tmp_steps] + rhs = data[k + _tmp_steps] flrgs = self.generate_lhs_flrg_fuzzyfied(sample) @@ -326,7 +314,7 @@
    [docs]class WeightedHighOrderFTS(HighOrderFTS): """Weighted High Order Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(WeightedHighOrderFTS, self).__init__(**kwargs) self.name = "Weighted High Order FTS" self.shortname = "WHOFTS" @@ -363,7 +351,7 @@

    Quick search

    @@ -382,14 +370,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/hwang.html b/docs/build/html/_modules/pyFTS/models/hwang.html index 89f079d..0a7b851 100644 --- a/docs/build/html/_modules/pyFTS/models/hwang.html +++ b/docs/build/html/_modules/pyFTS/models/hwang.html @@ -5,31 +5,19 @@ - - pyFTS.models.hwang — pyFTS 1.6 documentation - - + + pyFTS.models.hwang — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,11 +51,11 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, Transformations, fts +from pyFTS.common import FuzzySet, FLR, fts
    [docs]class HighOrderFTS(fts.FTS): - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(HighOrderFTS, self).__init__(**kwargs) self.is_high_order = True self.min_order = 2 @@ -84,7 +72,7 @@
    [docs] def forecast(self, ndata, **kwargs): - l = len(self.sets) + l = len(self.partitioner) cn = np.array([0.0 for k in range(l)]) ow = np.array([[0.0 for k in range(l)] for z in range(self.order - 1)]) @@ -97,9 +85,9 @@ for ix in range(l): s = self.partitioner.ordered_sets[ix] - cn[ix] = self.sets[s].membership( FuzzySet.grant_bounds(ndata[t], self.sets, self.partitioner.ordered_sets)) + cn[ix] = self.partitioner.sets[s].membership( FuzzySet.grant_bounds(ndata[t], self.partitioner.sets, self.partitioner.ordered_sets)) for w in np.arange(self.order-1): - ow[w, ix] = self.sets[s].membership(FuzzySet.grant_bounds(ndata[t - w], self.sets, self.partitioner.ordered_sets)) + ow[w, ix] = self.partitioner.sets[s].membership(FuzzySet.grant_bounds(ndata[t - w], self.partitioner.sets, self.partitioner.ordered_sets)) rn[w, ix] = ow[w, ix] * cn[ix] ft[ix] = max(ft[ix], rn[w, ix]) mft = max(ft) @@ -108,17 +96,13 @@ for ix in range(l): s = self.partitioner.ordered_sets[ix] if ft[ix] == mft: - out = out + self.sets[s].centroid + out = out + self.partitioner.sets[s].centroid count += 1.0 ret.append(out / count) return ret
    [docs] def train(self, data, **kwargs): - - if self.sets == None: - self.sets = self.partitioner.sets - self.configure_lags(**kwargs)
    @@ -132,7 +116,7 @@

    Quick search

    @@ -151,14 +135,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/ifts.html b/docs/build/html/_modules/pyFTS/models/ifts.html index 4b9e9b8..178c7f6 100644 --- a/docs/build/html/_modules/pyFTS/models/ifts.html +++ b/docs/build/html/_modules/pyFTS/models/ifts.html @@ -5,31 +5,19 @@ - - pyFTS.models.ifts — pyFTS 1.6 documentation - - + + pyFTS.models.ifts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -66,15 +54,15 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts, tree -from pyFTS.models import hofts +from pyFTS.common import FuzzySet, FLR, fts, tree +from pyFTS.models import hofts
    [docs]class IntervalFTS(hofts.HighOrderFTS): """ High Order Interval Fuzzy Time Series """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(IntervalFTS, self).__init__(**kwargs) self.shortname = "IFTS" self.name = "Interval FTS" @@ -160,7 +148,7 @@ """ Weighted High Order Interval Fuzzy Time Series """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(WeightedIntervalFTS, self).__init__(**kwargs) self.shortname = "WIFTS" self.name = "Weighted Interval FTS" @@ -253,7 +241,7 @@

    Quick search

    @@ -272,14 +260,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/incremental/IncrementalEnsemble.html b/docs/build/html/_modules/pyFTS/models/incremental/IncrementalEnsemble.html index c3e2664..56e0410 100644 --- a/docs/build/html/_modules/pyFTS/models/incremental/IncrementalEnsemble.html +++ b/docs/build/html/_modules/pyFTS/models/incremental/IncrementalEnsemble.html @@ -5,31 +5,19 @@ - - pyFTS.models.incremental.IncrementalEnsemble — pyFTS 1.6 documentation - - + + pyFTS.models.incremental.IncrementalEnsemble — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -62,17 +50,17 @@ import numpy as np import pandas as pd -from pyFTS.common import FuzzySet, FLR, fts, flrg -from pyFTS.partitioners import Grid -from pyFTS.models import hofts -from pyFTS.models.ensemble import ensemble +from pyFTS.common import FuzzySet, FLR, fts, flrg +from pyFTS.partitioners import Grid +from pyFTS.models import hofts +from pyFTS.models.ensemble import ensemble
    [docs]class IncrementalEnsembleFTS(ensemble.EnsembleFTS): """ Time Variant/Incremental Ensemble of FTS methods """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(IncrementalEnsembleFTS, self).__init__(**kwargs) self.shortname = "IncrementalEnsembleFTS" self.name = "Incremental Ensemble FTS" @@ -192,7 +180,7 @@

    Quick search

    @@ -211,14 +199,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/incremental/TimeVariant.html b/docs/build/html/_modules/pyFTS/models/incremental/TimeVariant.html index 88a3cac..52cd59b 100644 --- a/docs/build/html/_modules/pyFTS/models/incremental/TimeVariant.html +++ b/docs/build/html/_modules/pyFTS/models/incremental/TimeVariant.html @@ -5,31 +5,19 @@ - - pyFTS.models.incremental.TimeVariant — pyFTS 1.6 documentation - - + + pyFTS.models.incremental.TimeVariant — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,8 +49,8 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts, flrg -from pyFTS.partitioners import Grid +from pyFTS.common import FuzzySet, FLR, fts, flrg +from pyFTS.partitioners import Grid
    [docs]class Retrainer(fts.FTS): @@ -71,7 +59,7 @@ data windows controlled by the parameter 'batch_size', using as the training data a window of recent lags, whose size is controlled by the parameter 'window_length'. """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(Retrainer, self).__init__(**kwargs) self.partitioner_method = kwargs.get('partitioner_method', Grid.GridPartitioner) @@ -159,12 +147,12 @@
    [docs] def offset(self): return self.max_lag
    - def __str__(self): + def __str__(self): """String representation of the model""" return str(self.model) - def __len__(self): + def __len__(self): """ The length (number of rules) of the model @@ -183,7 +171,7 @@

    Quick search

    @@ -202,14 +190,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/ismailefendi.html b/docs/build/html/_modules/pyFTS/models/ismailefendi.html index b59e220..9dbb840 100644 --- a/docs/build/html/_modules/pyFTS/models/ismailefendi.html +++ b/docs/build/html/_modules/pyFTS/models/ismailefendi.html @@ -5,31 +5,19 @@ - - pyFTS.models.ismailefendi — pyFTS 1.6 documentation - - + + pyFTS.models.ismailefendi — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,12 +51,12 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts, flrg +from pyFTS.common import FuzzySet, FLR, fts, flrg
    [docs]class ImprovedWeightedFLRG(flrg.FLRG): """First Order Improved Weighted Fuzzy Logical Relationship Group""" - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(ImprovedWeightedFLRG, self).__init__(1, **kwargs) self.LHS = LHS self.RHS = {} @@ -90,7 +78,7 @@ self.w = np.array([self.rhs_counts[c] / self.count for c in self.RHS.keys()]) return self.w
    - def __str__(self): + def __str__(self): tmp = self.LHS + " -> " tmp2 = "" for c in sorted(self.RHS.keys()): @@ -99,13 +87,13 @@ tmp2 = tmp2 + c + "(" + str(round(self.rhs_counts[c] / self.count, 3)) + ")" return tmp + tmp2 - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs]class ImprovedWeightedFTS(fts.FTS): """First Order Improved Weighted Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ImprovedWeightedFTS, self).__init__(order=1, name="IWFTS", **kwargs) self.name = "Improved Weighted FTS" self.detail = "Ismail & Efendi" @@ -179,7 +167,7 @@

    Quick search

    @@ -198,14 +186,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/FLR.html b/docs/build/html/_modules/pyFTS/models/multivariate/FLR.html index d225313..a6d4485 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/FLR.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/FLR.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.FLR — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.FLR — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,7 +48,7 @@
    [docs]class FLR(object): """Multivariate Fuzzy Logical Relationship""" - def __init__(self): + def __init__(self): """ Creates a Fuzzy Logical Relationship :param LHS: Left Hand Side fuzzy set @@ -75,7 +63,7 @@
    [docs] def set_rhs(self, set): self.RHS = set
    - def __str__(self): + def __str__(self): return "{} -> {}".format([k for k in self.LHS.values()], self.RHS)
    @@ -92,7 +80,7 @@

    Quick search

    @@ -111,14 +99,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/cmvfts.html b/docs/build/html/_modules/pyFTS/models/multivariate/cmvfts.html index b09165c..5e2642d 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/cmvfts.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/cmvfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.cmvfts — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.cmvfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -58,17 +46,17 @@ import numpy as np import pandas as pd -from pyFTS.common import FuzzySet, FLR, fts, flrg -from pyFTS.models import hofts -from pyFTS.models.multivariate import mvfts, grid, common -from types import LambdaType +from pyFTS.common import FuzzySet, FLR, fts, flrg +from pyFTS.models import hofts +from pyFTS.models.multivariate import mvfts, grid, common +from types import LambdaType
    [docs]class ClusteredMVFTS(mvfts.MVFTS): """ Meta model for high order, clustered multivariate FTS """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ClusteredMVFTS, self).__init__(**kwargs) self.fts_method = kwargs.get('fts_method', hofts.WeightedHighOrderFTS) @@ -260,11 +248,11 @@ return ret
    - def __str__(self): + def __str__(self): """String representation of the model""" return str(self.model) - def __len__(self): + def __len__(self): """ The length (number of rules) of the model @@ -284,7 +272,7 @@

    Quick search

    @@ -303,14 +291,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/common.html b/docs/build/html/_modules/pyFTS/models/multivariate/common.html index b87d60f..477daf8 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/common.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/common.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.common — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.common — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -57,14 +45,14 @@

    Source code for pyFTS.models.multivariate.common

     import numpy as np
     import pandas as pd
    -from pyFTS.common import FuzzySet, Composite
    +from pyFTS.common import FuzzySet, Composite
     
     
     
    [docs]class MultivariateFuzzySet(Composite.FuzzySet): """ Multivariate Composite Fuzzy Set """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Create an empty composite fuzzy set :param name: fuzzy set name @@ -144,7 +132,7 @@

    Quick search

    @@ -163,14 +151,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/flrg.html b/docs/build/html/_modules/pyFTS/models/multivariate/flrg.html index 6aabf6c..5193938 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/flrg.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/flrg.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.flrg — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.flrg — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -57,7 +45,7 @@

    Source code for pyFTS.models.multivariate.flrg

     
     import numpy as np
    -from pyFTS.common import flrg as flg
    +from pyFTS.common import flrg as flg
     
     
     
    [docs]class FLRG(flg.FLRG): @@ -65,7 +53,7 @@ Multivariate Fuzzy Logical Rule Group """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(FLRG,self).__init__(0,**kwargs) self.order = kwargs.get('order', 1) self.LHS = kwargs.get('lhs', {}) @@ -102,7 +90,7 @@ return self.upper
    - def __str__(self): + def __str__(self): _str = "" for k in self.RHS: _str += "," if len(_str) > 0 else "" @@ -121,7 +109,7 @@

    Quick search

    @@ -140,14 +128,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/granular.html b/docs/build/html/_modules/pyFTS/models/multivariate/granular.html index 44bb5ac..78d7440 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/granular.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/granular.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.granular — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.granular — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,8 +43,8 @@

    Source code for pyFTS.models.multivariate.granular

    -from pyFTS.models.multivariate import cmvfts, grid
    -from pyFTS.models import hofts
    +from pyFTS.models.multivariate import cmvfts, grid
    +from pyFTS.models import hofts
     
     
     
    [docs]class GranularWMVFTS(cmvfts.ClusteredMVFTS): @@ -64,7 +52,7 @@ Granular multivariate weighted high order FTS """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(GranularWMVFTS, self).__init__(**kwargs) self.fts_method = kwargs.get('fts_method', hofts.WeightedHighOrderFTS) @@ -95,7 +83,7 @@

    Quick search

    @@ -114,14 +102,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/grid.html b/docs/build/html/_modules/pyFTS/models/multivariate/grid.html index 748f7a7..66b158b 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/grid.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/grid.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.grid — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.grid — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,10 +43,10 @@

    Source code for pyFTS.models.multivariate.grid

    -from pyFTS.models.multivariate import partitioner
    -from pyFTS.models.multivariate.common import MultivariateFuzzySet, fuzzyfy_instance_clustered
    -from itertools import product
    -from scipy.spatial import KDTree
    +from pyFTS.models.multivariate import partitioner
    +from pyFTS.models.multivariate.common import MultivariateFuzzySet, fuzzyfy_instance_clustered
    +from itertools import product
    +from scipy.spatial import KDTree
     import numpy as np
     import pandas as pd
     
    @@ -68,7 +56,7 @@
         A cartesian product of all fuzzy sets of all variables
         """
     
    -    def __init__(self, **kwargs):
    +    def __init__(self, **kwargs):
             super(GridCluster, self).__init__(**kwargs)
             self.name="GridCluster"
             self.build(None)
    @@ -123,7 +111,7 @@
         multivariate fuzzy set base.
         """
     
    -    def __init__(self, **kwargs):
    +    def __init__(self, **kwargs):
             super(IncrementalGridCluster, self).__init__(**kwargs)
             self.name="IncrementalGridCluster"
             self.build(None)
    @@ -205,7 +193,7 @@
       

    Quick search

    @@ -224,14 +212,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/mvfts.html b/docs/build/html/_modules/pyFTS/models/multivariate/mvfts.html index 2eaec27..71388b7 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/mvfts.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/mvfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.mvfts — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.mvfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,12 +43,12 @@

    Source code for pyFTS.models.multivariate.mvfts

    -from pyFTS.common import fts, FuzzySet, FLR, Membership
    -from pyFTS.partitioners import Grid
    -from pyFTS.models.multivariate import FLR as MVFLR, common, flrg as mvflrg
    -from itertools import product
    -from types import LambdaType
    -from copy import deepcopy
    +from pyFTS.common import fts, FuzzySet, FLR, Membership
    +from pyFTS.partitioners import Grid
    +from pyFTS.models.multivariate import FLR as MVFLR, common, flrg as mvflrg
    +from itertools import product
    +from types import LambdaType
    +from copy import deepcopy
     
     import numpy as np
     import pandas as pd
    @@ -82,7 +70,7 @@
         """
         Multivariate extension of Chen's ConventionalFTS method
         """
    -    def __init__(self, **kwargs):
    +    def __init__(self, **kwargs):
             super(MVFTS, self).__init__(**kwargs)
             self.explanatory_variables = kwargs.get('explanatory_variables',[])
             self.target_variable = kwargs.get('target_variable',None)
    @@ -375,7 +363,7 @@
             self.explanatory_variables = model.explanatory_variables
             self.target_variable = model.target_variable
    - def __str__(self): + def __str__(self): _str = self.name + ":\n" for k in self.flrgs.keys(): _str += str(self.flrgs[k]) + "\n" @@ -395,7 +383,7 @@

    Quick search

    @@ -414,14 +402,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/partitioner.html b/docs/build/html/_modules/pyFTS/models/multivariate/partitioner.html index ccf1e8a..c40e157 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/partitioner.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/partitioner.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.partitioner — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.partitioner — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,10 +43,10 @@

    Source code for pyFTS.models.multivariate.partitioner

    -from pyFTS.partitioners import partitioner
    -from pyFTS.models.multivariate.common import MultivariateFuzzySet, fuzzyfy_instance_clustered
    -from itertools import product
    -from scipy.spatial import KDTree
    +from pyFTS.partitioners import partitioner
    +from pyFTS.models.multivariate.common import MultivariateFuzzySet, fuzzyfy_instance_clustered
    +from itertools import product
    +from scipy.spatial import KDTree
     import numpy as np
     import pandas as pd
     
    @@ -68,7 +56,7 @@
         Base class for partitioners which use the MultivariateFuzzySet
         """
     
    -    def __init__(self, **kwargs):
    +    def __init__(self, **kwargs):
             super(MultivariatePartitioner, self).__init__(name="MultivariatePartitioner", preprocess=False, **kwargs)
     
             self.type = 'multivariate'
    @@ -187,7 +175,7 @@
       

    Quick search

    @@ -206,14 +194,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/variable.html b/docs/build/html/_modules/pyFTS/models/multivariate/variable.html index bcc1afb..2b7b99d 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/variable.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/variable.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.variable — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.variable — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,9 +44,9 @@

    Source code for pyFTS.models.multivariate.variable

     import pandas as pd
    -from pyFTS.common import fts, FuzzySet, FLR, Membership, tree
    -from pyFTS.partitioners import Grid
    -from pyFTS.models.multivariate import FLR as MVFLR
    +from pyFTS.common import fts, FuzzySet, FLR, Membership, tree
    +from pyFTS.partitioners import Grid
    +from pyFTS.models.multivariate import FLR as MVFLR
     
     
     
    [docs]class Variable: @@ -66,7 +54,7 @@ A variable of a fuzzy time series multivariate model. Each variable contains its own transformations and partitioners. """ - def __init__(self, name, **kwargs): + def __init__(self, name, **kwargs): """ :param name: @@ -104,11 +92,11 @@ :param kwargs: :return: """ - fs = kwargs.get('partitioner', Grid.GridPartitioner) - mf = kwargs.get('func', Membership.trimf) - np = kwargs.get('npart', 10) + fs = kwargs.pop('partitioner', Grid.GridPartitioner) + mf = kwargs.pop('func', Membership.trimf) + np = kwargs.pop('npart', 10) data = kwargs.get('data', None) - kw = kwargs.get('partitioner_specific', {}) + kw = kwargs.pop('partitioner_specific', {}) self.partitioner = fs(data=data[self.data_label].values, npart=np, func=mf, transformation=self.transformation, prefix=self.alias, variable=self.name, **kw) @@ -135,7 +123,7 @@ return data
    - def __str__(self): + def __str__(self): return self.name
    @@ -149,7 +137,7 @@

    Quick search

    @@ -168,14 +156,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html b/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html index 6d528a1..7f15c60 100644 --- a/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html +++ b/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.multivariate.wmvfts — pyFTS 1.6 documentation - - + + pyFTS.models.multivariate.wmvfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,9 +43,9 @@

    Source code for pyFTS.models.multivariate.wmvfts

    -from pyFTS.common import fts, FuzzySet, FLR, Membership, tree
    -from pyFTS.partitioners import Grid
    -from pyFTS.models.multivariate import mvfts, FLR as MVFLR, common, flrg as mvflrg
    +from pyFTS.common import fts, FuzzySet, FLR, Membership, tree
    +from pyFTS.partitioners import Grid
    +from pyFTS.models.multivariate import mvfts, FLR as MVFLR, common, flrg as mvflrg
     
     import numpy as np
     import pandas as pd
    @@ -68,7 +56,7 @@
         Weighted Multivariate Fuzzy Logical Rule Group
         """
     
    -    def __init__(self, **kwargs):
    +    def __init__(self, **kwargs):
             super(WeightedFLRG, self).__init__(**kwargs)
             self.order = kwargs.get('order', 1)
             self.LHS = kwargs.get('lhs', {})
    @@ -108,7 +96,7 @@
                 self.upper = up.dot(self.weights())
             return self.upper
    - def __str__(self): + def __str__(self): _str = "" for k in self.RHS.keys(): _str += ", " if len(_str) > 0 else "" @@ -121,7 +109,7 @@ """ Weighted Multivariate FTS """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(WeightedMVFTS, self).__init__(order=1, **kwargs) self.shortname = "WeightedMVFTS" self.name = "Weighted Multivariate FTS" @@ -146,7 +134,7 @@

    Quick search

    @@ -165,14 +153,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/common.html b/docs/build/html/_modules/pyFTS/models/nonstationary/common.html index 9e707d9..5e8e912 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/common.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/common.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.common — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.common — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,10 +51,10 @@ """ import numpy as np -from pyFTS import * -from pyFTS.common import FuzzySet as FS, Membership, FLR -from pyFTS.partitioners import partitioner -from pyFTS.models.nonstationary import perturbation +from pyFTS import * +from pyFTS.common import FuzzySet as FS, Membership, FLR +from pyFTS.partitioners import partitioner +from pyFTS.models.nonstationary import perturbation
    [docs]class FuzzySet(FS.FuzzySet): @@ -74,7 +62,7 @@ Non Stationary Fuzzy Sets """ - def __init__(self, name, mf, parameters, **kwargs): + def __init__(self, name, mf, parameters, **kwargs): """ Constructor """ @@ -229,7 +217,7 @@ else: return param
    - def __str__(self): + def __str__(self): tmp = "" if self.location is not None: tmp += "Location: " @@ -309,7 +297,7 @@

    Quick search

    @@ -328,14 +316,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/cvfts.html b/docs/build/html/_modules/pyFTS/models/nonstationary/cvfts.html index 29c3f72..6f9e09a 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/cvfts.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/cvfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.cvfts — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.cvfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,14 +44,14 @@

    Source code for pyFTS.models.nonstationary.cvfts

     import numpy as np
    -from pyFTS.models import hofts
    -from pyFTS.models.nonstationary import common,nsfts
    -from pyFTS.common import FLR, flrg, tree
    +from pyFTS.models import hofts
    +from pyFTS.models.nonstationary import common,nsfts
    +from pyFTS.common import FLR, flrg, tree
     
     
     
    [docs]class HighOrderNonstationaryFLRG(hofts.HighOrderFTS): """Conventional High Order Fuzzy Logical Relationship Group""" - def __init__(self, order, **kwargs): + def __init__(self, order, **kwargs): super(HighOrderNonstationaryFLRG, self).__init__(order, **kwargs) self.LHS = [] self.RHS = {} @@ -76,7 +64,7 @@
    [docs] def append_lhs(self, c): self.LHS.append(c)
    - def __str__(self): + def __str__(self): tmp = "" for c in sorted(self.RHS): if len(tmp) > 0: @@ -85,12 +73,12 @@ return self.get_key() + " -> " + tmp - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs]class ConditionalVarianceFTS(hofts.HighOrderFTS): - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ConditionalVarianceFTS, self).__init__(**kwargs) self.name = "Conditional Variance FTS" self.shortname = "CVFTS " @@ -339,7 +327,7 @@

    Quick search

    @@ -358,14 +346,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/flrg.html b/docs/build/html/_modules/pyFTS/models/nonstationary/flrg.html index 31f3dde..b145db6 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/flrg.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/flrg.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.flrg — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.flrg — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,8 +44,8 @@

    Source code for pyFTS.models.nonstationary.flrg

     
    -from pyFTS.common import flrg
    -from pyFTS.models.nonstationary import common
    +from pyFTS.common import flrg
    +from pyFTS.models.nonstationary import common
     import numpy as np
     
     
    @@ -75,7 +63,7 @@
     
             return (sets, t, w)
    - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(NonStationaryFLRG, self).__init__(1, **kwargs) self.LHS = LHS self.RHS = set() @@ -140,7 +128,7 @@

    Quick search

    @@ -159,14 +147,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/honsfts.html b/docs/build/html/_modules/pyFTS/models/nonstationary/honsfts.html index a07c2d8..45d9306 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/honsfts.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/honsfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.honsfts — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.honsfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,15 +44,15 @@

    Source code for pyFTS.models.nonstationary.honsfts

     import numpy as np
    -from pyFTS.common import FuzzySet, FLR, fts
    -from pyFTS.models import hofts
    -from pyFTS.models.nonstationary import common, flrg, nsfts
    -from itertools import product
    +from pyFTS.common import FuzzySet, FLR, fts
    +from pyFTS.models import hofts
    +from pyFTS.models.nonstationary import common, flrg, nsfts
    +from itertools import product
     
     
     
    [docs]class HighOrderNonStationaryFLRG(flrg.NonStationaryFLRG): """First Order NonStationary Fuzzy Logical Relationship Group""" - def __init__(self, order, **kwargs): + def __init__(self, order, **kwargs): super(HighOrderNonStationaryFLRG, self).__init__(order, **kwargs) self.LHS = [] self.RHS = {} @@ -103,7 +91,7 @@ upper = up.dot(self.weights()) return upper
    - def __str__(self): + def __str__(self): _str = "" for k in self.RHS.keys(): _str += ", " if len(_str) > 0 else "" @@ -111,13 +99,13 @@ return self.get_key() + " -> " + _str - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs]class HighOrderNonStationaryFTS(nsfts.NonStationaryFTS): """NonStationaryFTS Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(HighOrderNonStationaryFTS, self).__init__(**kwargs) self.name = "High Order Non Stationary FTS" self.shortname = "HONSFTS" @@ -308,7 +296,7 @@ return ret
    - def __str__(self): + def __str__(self): tmp = self.name + ":\n" for r in self.flrgs: tmp = "{0}{1}\n".format(tmp, str(self.flrgs[r])) @@ -325,7 +313,7 @@

    Quick search

    @@ -344,14 +332,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/nsfts.html b/docs/build/html/_modules/pyFTS/models/nonstationary/nsfts.html index a09da74..3befff3 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/nsfts.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/nsfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.nsfts — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.nsfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,14 +44,14 @@

    Source code for pyFTS.models.nonstationary.nsfts

     import numpy as np
    -from pyFTS.common import FLR, fts
    -from pyFTS.models.nonstationary import common, flrg
    +from pyFTS.common import FLR, fts
    +from pyFTS.models.nonstationary import common, flrg
     
     
     
    [docs]class ConventionalNonStationaryFLRG(flrg.NonStationaryFLRG): """First Order NonStationary Fuzzy Logical Relationship Group""" - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(ConventionalNonStationaryFLRG, self).__init__(1, **kwargs) self.LHS = LHS self.RHS = set() @@ -74,7 +62,7 @@
    [docs] def append_rhs(self, c, **kwargs): self.RHS.add(c)
    - def __str__(self): + def __str__(self): tmp = self.LHS + " -> " tmp2 = "" for c in sorted(self.RHS): @@ -87,7 +75,7 @@
    [docs]class WeightedNonStationaryFLRG(flrg.NonStationaryFLRG): """First Order NonStationary Fuzzy Logical Relationship Group""" - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(WeightedNonStationaryFLRG, self).__init__(1, **kwargs) self.LHS = LHS self.RHS = {} @@ -115,7 +103,7 @@ midpoint = mp.dot(self.weights()) return midpoint
    - def __str__(self): + def __str__(self): _str = "" for k in self.RHS.keys(): _str += ", " if len(_str) > 0 else "" @@ -126,7 +114,7 @@
    [docs]class NonStationaryFTS(fts.FTS): """NonStationaryFTS Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(NonStationaryFTS, self).__init__(**kwargs) self.name = "Non Stationary FTS" self.shortname = "NSFTS" @@ -367,7 +355,7 @@ return ret
    - def __str__(self): + def __str__(self): tmp = self.name + ":\n" for r in self.flrgs: tmp = "{0}{1}\n".format(tmp, str(self.flrgs[r])) @@ -376,7 +364,7 @@
    [docs]class WeightedNonStationaryFTS(NonStationaryFTS): """Weighted NonStationaryFTS Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(WeightedNonStationaryFTS, self).__init__(**kwargs) self.name = "Weighted Non Stationary FTS" self.shortname = "WNSFTS" @@ -426,7 +414,7 @@

    Quick search

    @@ -445,14 +433,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/partitioners.html b/docs/build/html/_modules/pyFTS/models/nonstationary/partitioners.html index 5cb7d66..18008e3 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/partitioners.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/partitioners.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.partitioners — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.partitioners — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,9 +44,9 @@

    Source code for pyFTS.models.nonstationary.partitioners

     import numpy as np
    -from pyFTS.partitioners import partitioner
    -from pyFTS.models.nonstationary import common, perturbation
    -from pyFTS.common import FuzzySet as stationary_fs
    +from pyFTS.partitioners import partitioner
    +from pyFTS.models.nonstationary import common, perturbation
    +from pyFTS.common import FuzzySet as stationary_fs
     
     
     
    [docs]class PolynomialNonStationaryPartitioner(partitioner.Partitioner): @@ -66,7 +54,7 @@ Non Stationary Universe of Discourse Partitioner """ - def __init__(self, data, part, **kwargs): + def __init__(self, data, part, **kwargs): """""" super(PolynomialNonStationaryPartitioner, self).__init__(name=part.name, data=data, npart=part.partitions, func=part.membership_function, names=part.setnames, @@ -171,7 +159,7 @@ Non Stationary Universe of Discourse Partitioner """ - def __init__(self, data, part, **kwargs): + def __init__(self, data, part, **kwargs): """""" super(SimpleNonStationaryPartitioner, self).__init__(name=part.name, data=data, npart=part.partitions, func=part.membership_function, names=part.setnames, @@ -193,8 +181,8 @@
    [docs]def simplenonstationary_gridpartitioner_builder(data, npart, transformation): - from pyFTS.partitioners import Grid - from pyFTS.models.nonstationary import perturbation, partitioners + from pyFTS.partitioners import Grid + from pyFTS.models.nonstationary import perturbation, partitioners tmp_fs = Grid.GridPartitioner(data=data, npart=npart, transformation=transformation) fs = partitioners.SimpleNonStationaryPartitioner(data, tmp_fs, @@ -217,7 +205,7 @@

    Quick search

    @@ -236,14 +224,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/perturbation.html b/docs/build/html/_modules/pyFTS/models/nonstationary/perturbation.html index 4f71aaf..7a81bec 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/perturbation.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/perturbation.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.perturbation — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.perturbation — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,8 +48,8 @@ """ import numpy as np -from pyFTS import * -from pyFTS.common import FuzzySet, Membership +from pyFTS import * +from pyFTS.common import FuzzySet, Membership
    [docs]def linear(x, parameters): @@ -90,7 +78,7 @@

    Quick search

    @@ -109,14 +97,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/nonstationary/util.html b/docs/build/html/_modules/pyFTS/models/nonstationary/util.html index 873cbe3..2e88677 100644 --- a/docs/build/html/_modules/pyFTS/models/nonstationary/util.html +++ b/docs/build/html/_modules/pyFTS/models/nonstationary/util.html @@ -5,31 +5,19 @@ - - pyFTS.models.nonstationary.util — pyFTS 1.6 documentation - - + + pyFTS.models.nonstationary.util — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -60,7 +48,7 @@ import matplotlib as plt import matplotlib.colors as pltcolors import matplotlib.pyplot as plt -from pyFTS.common import Membership, Util +from pyFTS.common import Membership, Util
    [docs]def plot_sets(partitioner, start=0, end=10, step=1, tam=[5, 5], colors=None, @@ -162,7 +150,7 @@

    Quick search

    @@ -181,14 +169,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/pwfts.html b/docs/build/html/_modules/pyFTS/models/pwfts.html index f4772b9..f5776d0 100644 --- a/docs/build/html/_modules/pyFTS/models/pwfts.html +++ b/docs/build/html/_modules/pyFTS/models/pwfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.pwfts — pyFTS 1.6 documentation - - + + pyFTS.models.pwfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,16 +49,16 @@ import numpy as np import pandas as pd import math -from operator import itemgetter -from pyFTS.common import FLR, FuzzySet -from pyFTS.models import hofts, ifts -from pyFTS.probabilistic import ProbabilityDistribution -from itertools import product +from operator import itemgetter +from pyFTS.common import FLR, FuzzySet +from pyFTS.models import hofts, ifts +from pyFTS.probabilistic import ProbabilityDistribution +from itertools import product
    [docs]class ProbabilisticWeightedFLRG(hofts.HighOrderFLRG): """High Order Probabilistic Weighted Fuzzy Logical Relationship Group""" - def __init__(self, order): + def __init__(self, order): super(ProbabilisticWeightedFLRG, self).__init__(order) self.RHS = {} self.frequency_count = 0.0 @@ -149,7 +137,7 @@ return self.lower
    - def __str__(self): + def __str__(self): tmp2 = "" for c in sorted(self.RHS.keys()): if len(tmp2) > 0: @@ -160,7 +148,7 @@
    [docs]class ProbabilisticWeightedFTS(ifts.IntervalFTS): """High Order Probabilistic Weighted Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ProbabilisticWeightedFTS, self).__init__(**kwargs) self.shortname = "PWFTS" self.name = "Probabilistic FTS" @@ -194,8 +182,9 @@ self.generate_flrg_fuzzyfied(fuzz)
    [docs] def generate_flrg_fuzzyfied(self, data): + _tmp_steps = self.standard_horizon - 1 l = len(data) - for k in np.arange(self.max_lag, l): + for k in np.arange(self.max_lag, l - _tmp_steps): sample = data[k - self.max_lag: k] set_sample = [] for instance in sample: @@ -211,8 +200,8 @@ lhs_mv = self.pwflrg_lhs_memberhip_fuzzyfied(flrg, sample) mvs = [] - inst = data[k] - for set, mv in inst: + rhs = data[k + _tmp_steps] + for set, mv in rhs: self.flrgs[flrg.get_key()].append_rhs(set, count=lhs_mv * mv) mvs.append(mv) @@ -260,8 +249,9 @@ return flrgs
    [docs] def generate_flrg(self, data): + _tmp_steps = self.standard_horizon - 1 l = len(data) - for k in np.arange(self.max_lag, l): + for k in np.arange(self.max_lag, l - _tmp_steps): if self.dump: print("FLR: " + str(k)) sample = data[k - self.max_lag: k] @@ -275,7 +265,7 @@ if flrg.get_key() not in self.flrgs: self.flrgs[flrg.get_key()] = flrg; - fuzzyfied = self.partitioner.fuzzyfy(data[k], mode='both', method='fuzzy', + fuzzyfied = self.partitioner.fuzzyfy(data[k+_tmp_steps], mode='both', method='fuzzy', alpha_cut=self.alpha_cut) mvs = [] @@ -708,7 +698,7 @@ return dist
    - def __str__(self): + def __str__(self): tmp = self.name + ":\n" for r in sorted(self.flrgs.keys()): p = round(self.flrgs[r].frequency_count / self.global_frequency_count, 3) @@ -716,22 +706,29 @@ return tmp
    -
    [docs]def visualize_distributions(model, **kwargs): - import matplotlib.pyplot as plt - from matplotlib import gridspec - import seaborn as sns - +
    [docs]def highorder_fuzzy_markov_chain(model): ordered_sets = model.partitioner.ordered_sets + ftpg_keys = sorted(model.flrgs.keys(), key=lambda x: model.flrgs[x].get_midpoint(model.sets)) - - lhs_probs = [model.flrg_lhs_unconditional_probability(model.flrgs[k]) - for k in ftpg_keys] + + lhs_probs = np.array([model.flrg_lhs_unconditional_probability(model.flrgs[k]) + for k in ftpg_keys]) mat = np.zeros((len(ftpg_keys), len(ordered_sets))) for row, w in enumerate(ftpg_keys): for col, k in enumerate(ordered_sets): if k in model.flrgs[w].RHS: mat[row, col] = model.flrgs[w].rhs_unconditional_probability(k) + + return ftpg_keys, ordered_sets, lhs_probs, mat
    + + +
    [docs]def visualize_distributions(model, **kwargs): + import matplotlib.pyplot as plt + from matplotlib import gridspec + import seaborn as sns + + ftpg_keys, ordered_sets, lhs_probs, mat = highorder_fuzzy_markov_chain(model) size = kwargs.get('size', (5,10)) @@ -750,6 +747,8 @@ ax.set_xticklabels(ordered_sets) ax.grid(True) ax.xaxis.set_tick_params(rotation=90)
    + +
    @@ -762,7 +761,7 @@

    Quick search

    @@ -781,14 +780,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/sadaei.html b/docs/build/html/_modules/pyFTS/models/sadaei.html index 29210a1..a5653ec 100644 --- a/docs/build/html/_modules/pyFTS/models/sadaei.html +++ b/docs/build/html/_modules/pyFTS/models/sadaei.html @@ -5,31 +5,19 @@ - - pyFTS.models.sadaei — pyFTS 1.6 documentation - - + + pyFTS.models.sadaei — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,14 +51,14 @@ """ import numpy as np -from pyFTS.common import FuzzySet,FLR,fts, flrg +from pyFTS.common import FuzzySet,FLR,fts, flrg default_c = 1.1
    [docs]class ExponentialyWeightedFLRG(flrg.FLRG): """First Order Exponentialy Weighted Fuzzy Logical Relationship Group""" - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(ExponentialyWeightedFLRG, self).__init__(1, **kwargs) self.LHS = LHS self.RHS = [] @@ -90,7 +78,7 @@ self.w = np.array([k / tot for k in wei]) return self.w
    - def __str__(self): + def __str__(self): tmp = self.LHS + " -> " tmp2 = "" cc = 0 @@ -103,13 +91,13 @@ cc = cc + 1 return tmp + tmp2 - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs]class ExponentialyWeightedFTS(fts.FTS): """First Order Exponentialy Weighted Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ExponentialyWeightedFTS, self).__init__(order=1, name="EWFTS", **kwargs) self.name = "Exponentialy Weighted FTS" self.detail = "Sadaei" @@ -183,7 +171,7 @@

    Quick search

    @@ -202,14 +190,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/seasonal/SeasonalIndexer.html b/docs/build/html/_modules/pyFTS/models/seasonal/SeasonalIndexer.html index f1b8e21..0aaa3d8 100644 --- a/docs/build/html/_modules/pyFTS/models/seasonal/SeasonalIndexer.html +++ b/docs/build/html/_modules/pyFTS/models/seasonal/SeasonalIndexer.html @@ -5,31 +5,19 @@ - - pyFTS.models.seasonal.SeasonalIndexer — pyFTS 1.6 documentation - - + + pyFTS.models.seasonal.SeasonalIndexer — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -57,14 +45,14 @@

    Source code for pyFTS.models.seasonal.SeasonalIndexer

     import numpy as np
     import pandas as pd
    -from pyFTS.models.seasonal import common
    +from pyFTS.models.seasonal import common
     
     
     
    [docs]class SeasonalIndexer(object): """ Seasonal Indexer. Responsible to find the seasonal index of a data point inside its data set """ - def __init__(self,num_seasons, **kwargs): + def __init__(self,num_seasons, **kwargs): self.num_seasons = num_seasons self.name = kwargs.get("name","") @@ -89,7 +77,7 @@
    [docs]class LinearSeasonalIndexer(SeasonalIndexer): """Use the data array/list position to index the seasonality """ - def __init__(self, seasons, units, ignore=None, **kwargs): + def __init__(self, seasons, units, ignore=None, **kwargs): """ Indexer for array/list position :param seasons: A list with the season group (i.e: 7 for week, 30 for month, etc) @@ -147,7 +135,7 @@
    [docs]class DataFrameSeasonalIndexer(SeasonalIndexer): """Use the Pandas.DataFrame index position to index the seasonality """ - def __init__(self,index_fields,index_seasons, data_field,**kwargs): + def __init__(self,index_fields,index_seasons, data_field,**kwargs): """ :param index_fields: DataFrame field to use as index @@ -199,7 +187,7 @@
    [docs]class DateTimeSeasonalIndexer(SeasonalIndexer): """Use a Pandas.DataFrame date field to index the seasonality """ - def __init__(self,date_field, index_fields, index_seasons, data_field,**kwargs): + def __init__(self,date_field, index_fields, index_seasons, data_field,**kwargs): """ :param date_field: DataFrame field that contains the datetime field used on index @@ -269,7 +257,7 @@

    Quick search

    @@ -288,14 +276,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/seasonal/cmsfts.html b/docs/build/html/_modules/pyFTS/models/seasonal/cmsfts.html index e03a8e8..c9037ed 100644 --- a/docs/build/html/_modules/pyFTS/models/seasonal/cmsfts.html +++ b/docs/build/html/_modules/pyFTS/models/seasonal/cmsfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.seasonal.cmsfts — pyFTS 1.6 documentation - - + + pyFTS.models.seasonal.cmsfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,16 +44,16 @@

    Source code for pyFTS.models.seasonal.cmsfts

     import numpy as np
    -from pyFTS.common import FuzzySet, FLR
    -from pyFTS.models.seasonal import sfts
    -from pyFTS.models import chen
    +from pyFTS.common import FuzzySet, FLR
    +from pyFTS.models.seasonal import sfts
    +from pyFTS.models import chen
     
     
     
    [docs]class ContextualSeasonalFLRG(sfts.SeasonalFLRG): """ Contextual Seasonal Fuzzy Logical Relationship Group """ - def __init__(self, seasonality): + def __init__(self, seasonality): super(ContextualSeasonalFLRG, self).__init__(seasonality) self.RHS = {} @@ -76,7 +64,7 @@ self.RHS[flr.LHS] = chen.ConventionalFLRG(flr.LHS) self.RHS[flr.LHS].append_rhs(flr.RHS)
    - def __str__(self): + def __str__(self): tmp = str(self.LHS) + ": \n " tmp2 = "\t" for r in sorted(self.RHS): @@ -88,7 +76,7 @@ """ Contextual Multi-Seasonal Fuzzy Time Series """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ContextualMultiSeasonalFTS, self).__init__(**kwargs) self.name = "Contextual Multi Seasonal FTS" self.shortname = "CMSFTS " @@ -177,7 +165,7 @@

    Quick search

    @@ -196,14 +184,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/seasonal/common.html b/docs/build/html/_modules/pyFTS/models/seasonal/common.html index 58575bb..ef0ad88 100644 --- a/docs/build/html/_modules/pyFTS/models/seasonal/common.html +++ b/docs/build/html/_modules/pyFTS/models/seasonal/common.html @@ -5,31 +5,19 @@ - - pyFTS.models.seasonal.common — pyFTS 1.6 documentation - - + + pyFTS.models.seasonal.common — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -57,10 +45,10 @@

    Source code for pyFTS.models.seasonal.common

     import numpy as np
     import pandas as pd
    -from enum import Enum
    -from pyFTS.common import FuzzySet, Membership
    -from pyFTS.partitioners import partitioner, Grid
    -from datetime import date as dt, datetime as dtm
    +from enum import Enum
    +from pyFTS.common import FuzzySet, Membership
    +from pyFTS.partitioners import partitioner, Grid
    +from datetime import date as dt, datetime as dtm
     
     
     
    [docs]class DateTime(Enum): @@ -156,7 +144,7 @@ Temporal/Seasonal Fuzzy Set """ - def __init__(self, datepart, name, mf, parameters, centroid, alpha=1.0, **kwargs): + def __init__(self, datepart, name, mf, parameters, centroid, alpha=1.0, **kwargs): super(FuzzySet, self).__init__(name, mf, parameters, centroid, alpha, **kwargs) self.datepart = datepart @@ -181,7 +169,7 @@

    Quick search

    @@ -200,14 +188,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/seasonal/msfts.html b/docs/build/html/_modules/pyFTS/models/seasonal/msfts.html index c5f8f46..6ae073d 100644 --- a/docs/build/html/_modules/pyFTS/models/seasonal/msfts.html +++ b/docs/build/html/_modules/pyFTS/models/seasonal/msfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.seasonal.msfts — pyFTS 1.6 documentation - - + + pyFTS.models.seasonal.msfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -56,15 +44,15 @@

    Source code for pyFTS.models.seasonal.msfts

     import numpy as np
    -from pyFTS.common import FLR
    -from pyFTS.models.seasonal import sfts
    +from pyFTS.common import FLR
    +from pyFTS.models.seasonal import sfts
     
     
     
    [docs]class MultiSeasonalFTS(sfts.SeasonalFTS): """ Multi-Seasonal Fuzzy Time Series """ - def __init__(self, name, indexer, **kwargs): + def __init__(self, name, indexer, **kwargs): super(MultiSeasonalFTS, self).__init__("MSFTS") self.name = "Multi Seasonal FTS" self.shortname = "MSFTS " + name @@ -133,7 +121,7 @@

    Quick search

    @@ -152,14 +140,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/seasonal/partitioner.html b/docs/build/html/_modules/pyFTS/models/seasonal/partitioner.html index f565da2..f808cde 100644 --- a/docs/build/html/_modules/pyFTS/models/seasonal/partitioner.html +++ b/docs/build/html/_modules/pyFTS/models/seasonal/partitioner.html @@ -5,31 +5,19 @@ - - pyFTS.models.seasonal.partitioner — pyFTS 1.6 documentation - - + + pyFTS.models.seasonal.partitioner — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,19 +43,19 @@

    Source code for pyFTS.models.seasonal.partitioner

    -from pyFTS.common import Membership, FuzzySet as FS
    -from pyFTS.common.Composite import FuzzySet as Composite
    -from pyFTS.partitioners import partitioner, Grid
    -from pyFTS.models.seasonal.common import DateTime, FuzzySet, strip_datepart
    +from pyFTS.common import Membership, FuzzySet as FS
    +from pyFTS.common.Composite import FuzzySet as Composite
    +from pyFTS.partitioners import partitioner, Grid
    +from pyFTS.models.seasonal.common import DateTime, FuzzySet, strip_datepart
     import numpy as np
     import matplotlib.pylab as plt
    -from scipy.spatial import KDTree
    +from scipy.spatial import KDTree
     
     
     
    [docs]class TimeGridPartitioner(partitioner.Partitioner): """Even Length DateTime Grid Partitioner""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Even Length Grid Partitioner :param seasonality: Time granularity, from pyFTS.models.seasonal.common.DateTime @@ -270,7 +258,7 @@

    Quick search

    @@ -289,14 +277,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/seasonal/sfts.html b/docs/build/html/_modules/pyFTS/models/seasonal/sfts.html index 798e701..8bbbbe4 100644 --- a/docs/build/html/_modules/pyFTS/models/seasonal/sfts.html +++ b/docs/build/html/_modules/pyFTS/models/seasonal/sfts.html @@ -5,31 +5,19 @@ - - pyFTS.models.seasonal.sfts — pyFTS 1.6 documentation - - + + pyFTS.models.seasonal.sfts — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,12 +52,12 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, flrg, fts +from pyFTS.common import FuzzySet, FLR, flrg, fts
    [docs]class SeasonalFLRG(flrg.FLRG): """First Order Seasonal Fuzzy Logical Relationship Group""" - def __init__(self, seasonality): + def __init__(self, seasonality): super(SeasonalFLRG, self).__init__(1) self.LHS = seasonality self.RHS = [] @@ -80,7 +68,7 @@
    [docs] def append_rhs(self, c, **kwargs): self.RHS.append(c)
    - def __str__(self): + def __str__(self): tmp = str(self.LHS) + " -> " tmp2 = "" for c in sorted(self.RHS, key=lambda s: str(s)): @@ -89,13 +77,13 @@ tmp2 = tmp2 + str(c) return tmp + tmp2 - def __len__(self): + def __len__(self): return len(self.RHS)
    [docs]class SeasonalFTS(fts.FTS): """First Order Seasonal Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(SeasonalFTS, self).__init__(**kwargs) self.name = "Seasonal FTS" self.shortname = "SFTS" @@ -149,7 +137,7 @@ return ret
    - def __str__(self): + def __str__(self): """String representation of the model""" tmp = self.name + ":\n" @@ -168,7 +156,7 @@

    Quick search

    @@ -187,14 +175,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/song.html b/docs/build/html/_modules/pyFTS/models/song.html index 6f4b440..53ea9e3 100644 --- a/docs/build/html/_modules/pyFTS/models/song.html +++ b/docs/build/html/_modules/pyFTS/models/song.html @@ -5,31 +5,19 @@ - - pyFTS.models.song — pyFTS 1.6 documentation - - + + pyFTS.models.song — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -62,29 +50,27 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts +from pyFTS.common import FuzzySet, FLR, fts
    [docs]class ConventionalFTS(fts.FTS): """Traditional Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(ConventionalFTS, self).__init__(order=1, name="FTS", **kwargs) self.name = "Traditional FTS" self.detail = "Song & Chissom" - if self.sets is not None and self.partitioner is not None: - self.sets = self.partitioner.sets self.R = None - if self.sets is not None: - l = len(self.sets) + if self.partitioner.sets is not None: + l = len(self.partitioner.sets) self.R = np.zeros((l,l))
    [docs] def flr_membership_matrix(self, flr): - ordered_set = FuzzySet.set_ordered(self.sets) - centroids = [self.sets[k].centroid for k in ordered_set] - lm = [self.sets[flr.LHS].membership(k) for k in centroids] - rm = [self.sets[flr.RHS].membership(k) for k in centroids] + ordered_set = FuzzySet.set_ordered(self.partitioner.sets) + centroids = [self.partitioner.sets[k].centroid for k in ordered_set] + lm = [self.partitioner.sets[flr.LHS].membership(k) for k in centroids] + rm = [self.partitioner.sets[flr.RHS].membership(k) for k in centroids] l = len(ordered_set) r = np.zeros((l, l)) @@ -95,7 +81,7 @@ return r
    [docs] def operation_matrix(self, flrs): - l = len(self.sets) + l = len(self.partitioner) if self.R is None or len(self.R) == 0 : self.R = np.zeros((l, l)) for k in flrs: @@ -116,30 +102,30 @@ if self.partitioner is not None: ordered_sets = self.partitioner.ordered_sets else: - ordered_sets = FuzzySet.set_ordered(self.sets) + ordered_sets = FuzzySet.set_ordered(self.partitioner.sets) l = len(ndata) - npart = len(self.sets) + npart = len(self.partitioner) ret = [] for k in np.arange(0, l): - mv = FuzzySet.fuzzyfy_instance(ndata[k], self.sets) + mv = FuzzySet.fuzzyfy_instance(ndata[k], self.partitioner.sets) r = [max([ min(self.R[i][j], mv[j]) for j in np.arange(0,npart) ]) for i in np.arange(0,npart)] fs = np.ravel(np.argwhere(r == max(r))) if len(fs) == 1: - ret.append(self.sets[ordered_sets[fs[0]]].centroid) + ret.append(self.partitioner.sets[ordered_sets[fs[0]]].centroid) else: - mp = [self.sets[ordered_sets[s]].centroid for s in fs] + mp = [self.partitioner.sets[ordered_sets[s]].centroid for s in fs] ret.append( sum(mp)/len(mp)) return ret
    - def __str__(self): + def __str__(self): tmp = self.name + ":\n" return tmp + str(self.R)
    @@ -154,7 +140,7 @@

    Quick search

    @@ -173,14 +159,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/models/yu.html b/docs/build/html/_modules/pyFTS/models/yu.html index fbc1a53..1a8ad8d 100644 --- a/docs/build/html/_modules/pyFTS/models/yu.html +++ b/docs/build/html/_modules/pyFTS/models/yu.html @@ -5,31 +5,19 @@ - - pyFTS.models.yu — pyFTS 1.6 documentation - - + + pyFTS.models.yu — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,13 +51,13 @@ """ import numpy as np -from pyFTS.common import FuzzySet, FLR, fts, flrg -from pyFTS.models import chen +from pyFTS.common import FuzzySet, FLR, fts, flrg +from pyFTS.models import chen
    [docs]class WeightedFLRG(flrg.FLRG): """First Order Weighted Fuzzy Logical Relationship Group""" - def __init__(self, LHS, **kwargs): + def __init__(self, LHS, **kwargs): super(WeightedFLRG, self).__init__(1, **kwargs) self.LHS = LHS self.RHS = [] @@ -87,7 +75,7 @@ self.w = np.array([k / tot for k in np.arange(1.0, self.count, 1.0)]) return self.w
    - def __str__(self): + def __str__(self): tmp = self.LHS + " -> " tmp2 = "" cc = 1.0 @@ -102,7 +90,7 @@
    [docs]class WeightedFTS(fts.FTS): """First Order Weighted Fuzzy Time Series""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(WeightedFTS, self).__init__(order=1, name="WFTS", **kwargs) self.name = "Weighted FTS" self.detail = "Yu" @@ -175,7 +163,7 @@

    Quick search

    @@ -194,14 +182,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/CMeans.html b/docs/build/html/_modules/pyFTS/partitioners/CMeans.html index 03854ce..1a1fa58 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/CMeans.html +++ b/docs/build/html/_modules/pyFTS/partitioners/CMeans.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.CMeans — pyFTS 1.6 documentation - - + + pyFTS.partitioners.CMeans — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -59,8 +47,8 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership -from pyFTS.partitioners import partitioner +from pyFTS.common import FuzzySet, Membership +from pyFTS.partitioners import partitioner
    [docs]def distance(x, y): @@ -135,7 +123,7 @@
    [docs]class CMeansPartitioner(partitioner.Partitioner): - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(CMeansPartitioner, self).__init__(name="CMeans", **kwargs)
    [docs] def build(self, data): @@ -167,7 +155,7 @@

    Quick search

    @@ -186,14 +174,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/Entropy.html b/docs/build/html/_modules/pyFTS/partitioners/Entropy.html index 4a93039..47bcf58 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/Entropy.html +++ b/docs/build/html/_modules/pyFTS/partitioners/Entropy.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.Entropy — pyFTS 1.6 documentation - - + + pyFTS.partitioners.Entropy — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,8 +52,8 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership -from pyFTS.partitioners import partitioner +from pyFTS.common import FuzzySet, Membership +from pyFTS.partitioners import partitioner
    [docs]def splitBelow(data,threshold): @@ -138,7 +126,7 @@
    [docs]class EntropyPartitioner(partitioner.Partitioner): """Huarng Entropy Partitioner""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(EntropyPartitioner, self).__init__(name="Entropy", **kwargs)
    [docs] def build(self, data): @@ -177,7 +165,7 @@

    Quick search

    @@ -196,14 +184,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/FCM.html b/docs/build/html/_modules/pyFTS/partitioners/FCM.html index 636e119..246f605 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/FCM.html +++ b/docs/build/html/_modules/pyFTS/partitioners/FCM.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.FCM — pyFTS 1.6 documentation - - + + pyFTS.partitioners.FCM — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,8 +52,8 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership -from pyFTS.partitioners import partitioner +from pyFTS.common import FuzzySet, Membership +from pyFTS.partitioners import partitioner
    [docs]def fuzzy_distance(x, y): @@ -152,7 +140,7 @@ """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(FCMPartitioner, self).__init__(name="FCM", **kwargs)
    [docs] def build(self, data): @@ -193,7 +181,7 @@

    Quick search

    @@ -212,14 +200,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/Grid.html b/docs/build/html/_modules/pyFTS/partitioners/Grid.html index fd7b705..53c1aaa 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/Grid.html +++ b/docs/build/html/_modules/pyFTS/partitioners/Grid.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.Grid — pyFTS 1.6 documentation - - + + pyFTS.partitioners.Grid — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,14 +49,14 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership -from pyFTS.partitioners import partitioner +from pyFTS.common import FuzzySet, Membership +from pyFTS.partitioners import partitioner
    [docs]class GridPartitioner(partitioner.Partitioner): """Even Length Grid Partitioner""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Even Length Grid Partitioner """ @@ -102,7 +90,7 @@
    [docs]class PreFixedGridPartitioner(GridPartitioner): """Prefixed UoD with Even Length Grid Partitioner""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Fixed UoD with Even Length Grid Partitioner """ @@ -142,7 +130,7 @@

    Quick search

    @@ -161,14 +149,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/Huarng.html b/docs/build/html/_modules/pyFTS/partitioners/Huarng.html index acf2a78..775f10e 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/Huarng.html +++ b/docs/build/html/_modules/pyFTS/partitioners/Huarng.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.Huarng — pyFTS 1.6 documentation - - + + pyFTS.partitioners.Huarng — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -64,13 +52,13 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership, Transformations +from pyFTS.common import FuzzySet, Membership, Transformations -from pyFTS.partitioners import partitioner +from pyFTS.partitioners import partitioner
    [docs]class HuarngPartitioner(partitioner.Partitioner): """Huarng Empirical Partitioner""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): super(HuarngPartitioner, self).__init__(name="Huarng", **kwargs)
    [docs] def build(self, data): @@ -122,7 +110,7 @@

    Quick search

    @@ -141,14 +129,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/Simple.html b/docs/build/html/_modules/pyFTS/partitioners/Simple.html index 931ddae..851ec21 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/Simple.html +++ b/docs/build/html/_modules/pyFTS/partitioners/Simple.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.Simple — pyFTS 1.6 documentation - - + + pyFTS.partitioners.Simple — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,14 +49,14 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership -from pyFTS.partitioners import partitioner +from pyFTS.common import FuzzySet, Membership +from pyFTS.partitioners import partitioner
    [docs]class SimplePartitioner(partitioner.Partitioner): """Simple Partitioner for manually informed fuzzy sets""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Simple Partitioner - the fuzzy sets are informed manually """ @@ -154,7 +142,7 @@

    Quick search

    @@ -173,14 +161,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/Singleton.html b/docs/build/html/_modules/pyFTS/partitioners/Singleton.html index 0975ff4..2189f6f 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/Singleton.html +++ b/docs/build/html/_modules/pyFTS/partitioners/Singleton.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.Singleton — pyFTS 1.6 documentation - - + + pyFTS.partitioners.Singleton — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,25 +49,25 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership -from pyFTS.partitioners import partitioner +from pyFTS.common import FuzzySet, Membership +from pyFTS.partitioners import partitioner
    [docs]class SingletonPartitioner(partitioner.Partitioner): - """Singleton Partitioner""" + """Singleton Partitioner: Create singleton fuzzy sets for each distinct value in UoD""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Singleton Partitioner """ super(SingletonPartitioner, self).__init__(name="Singleton", **kwargs) -
    [docs] def build(self, data): +
    [docs] def build(self, data : list): sets = {} kwargs = {'type': self.type, 'variable': self.variable} - for count, instance in enumerate(data): + for count, instance in enumerate(set(data)): _name = self.get_name(count) sets[_name] = FuzzySet.FuzzySet(_name, Membership.singleton, [instance], instance, **kwargs) @@ -96,7 +84,7 @@

    Quick search

    @@ -115,14 +103,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/SubClust.html b/docs/build/html/_modules/pyFTS/partitioners/SubClust.html index b9266a9..7e61a44 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/SubClust.html +++ b/docs/build/html/_modules/pyFTS/partitioners/SubClust.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.SubClust — pyFTS 1.6 documentation - - + + pyFTS.partitioners.SubClust — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -63,8 +51,8 @@ import math import random as rnd import functools, operator -from pyFTS.common import FuzzySet, Membership -from pyFTS.partitioners import partitioner +from pyFTS.common import FuzzySet, Membership +from pyFTS.partitioners import partitioner
    [docs]def imax(vec): @@ -118,7 +106,7 @@
    [docs]class SubClustPartitioner(partitioner.Partitioner): """Subtractive Clustering Partitioner""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): self.ra = kwargs.get('ra', 0.8) self.rb = kwargs.get('rb', self.ra * 1.5) self.eps_sup = kwargs.get('eps_sup', 0.5) @@ -163,7 +151,7 @@

    Quick search

    @@ -182,14 +170,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/Util.html b/docs/build/html/_modules/pyFTS/partitioners/Util.html index c3855c7..ef2403f 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/Util.html +++ b/docs/build/html/_modules/pyFTS/partitioners/Util.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.Util — pyFTS 1.6 documentation - - + + pyFTS.partitioners.Util — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -66,16 +54,20 @@ import matplotlib.pyplot as plt #from mpl_toolkits.mplot3d import Axes3D -from pyFTS.benchmarks import Measures -from pyFTS.common import Membership, Util -from pyFTS.partitioners import Grid,Huarng,FCM,Entropy +from pyFTS.benchmarks import Measures +from pyFTS.common import Membership, Util +from pyFTS.partitioners import Grid,Huarng,FCM,Entropy all_methods = [Grid.GridPartitioner, Entropy.EntropyPartitioner, FCM.FCMPartitioner, Huarng.HuarngPartitioner] mfs = [Membership.trimf, Membership.gaussmf, Membership.trapmf] -
    [docs]def plot_sets(data, sets, titles, size=[12, 10], save=False, file=None, axis=None): +
    [docs]def plot_sets(data, sets: dict, titles : list, size=[12, 10], save=False, file=None, axis=None): + """ + Plot all fuzzy sets in a Partitioner + + """ num = len(sets) if axis is None: @@ -110,7 +102,7 @@
    [docs]def plot_partitioners(data, objs, tam=[12, 10], save=False, file=None, axis=None): sets = [k.sets for k in objs] titles = [k.name for k in objs] - plot_sets(data, sets, titles, tam, save, file, axis)
    + plot_sets(sets, titles, tam, save, file, axis)
    [docs]def explore_partitioners(data, npart, methods=None, mf=None, transformation=None, @@ -141,7 +133,7 @@ obj.name = obj.name + " - " + obj.membership_function.__name__ objs.append(obj) - plot_partitioners(data, objs, size, save, file) + plot_partitioners(objs, size, save, file) return objs
    @@ -156,7 +148,7 @@

    Quick search

    @@ -175,14 +167,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/parallel_util.html b/docs/build/html/_modules/pyFTS/partitioners/parallel_util.html index 71e4683..92f3d1e 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/parallel_util.html +++ b/docs/build/html/_modules/pyFTS/partitioners/parallel_util.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.parallel_util — pyFTS 1.6 documentation - - + + pyFTS.partitioners.parallel_util — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,14 +43,14 @@

    Source code for pyFTS.partitioners.parallel_util

    -from copy import deepcopy
    -from joblib import Parallel, delayed
    +from copy import deepcopy
    +from joblib import Parallel, delayed
     import multiprocessing
     import  numpy as np
     
    -from pyFTS.common import Membership, Util
    -from pyFTS.partitioners import Grid,Huarng,FCM,Entropy
    -from pyFTS.partitioners import Util
    +from pyFTS.common import Membership, Util
    +from pyFTS.partitioners import Grid,Huarng,FCM,Entropy
    +from pyFTS.partitioners import Util
     
     
     
    [docs]def explore_partitioners(data, npart, methods=None, mf=None, tam=[12, 10], save=False, file=None): @@ -85,7 +73,7 @@ objs = np.ravel(objs).tolist() - Util.plot_partitioners(data, objs, tam, save, file)
    + Util.plot_partitioners(objs, tam, save, file)
    @@ -99,7 +87,7 @@

    Quick search

    @@ -118,14 +106,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/partitioners/partitioner.html b/docs/build/html/_modules/pyFTS/partitioners/partitioner.html index f50c1d7..9be5dd1 100644 --- a/docs/build/html/_modules/pyFTS/partitioners/partitioner.html +++ b/docs/build/html/_modules/pyFTS/partitioners/partitioner.html @@ -5,31 +5,19 @@ - - pyFTS.partitioners.partitioner — pyFTS 1.6 documentation - - + + pyFTS.partitioners.partitioner — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -55,11 +43,9 @@

    Source code for pyFTS.partitioners.partitioner

    -from pyFTS.common import FuzzySet, Membership
    +from pyFTS.common import FuzzySet, Membership
     import numpy as np
    -from scipy.spatial import KDTree
    -import matplotlib.pylab as plt
    -import logging
    +from scipy.spatial import KDTree
     
     
     
    [docs]class Partitioner(object): @@ -67,37 +53,38 @@ Universe of Discourse partitioner. Split data on several fuzzy sets """ - def __init__(self, **kwargs): + def __init__(self, **kwargs): """ Universe of Discourse partitioner scheme. Split data on several fuzzy sets """ - self.name = kwargs.get('name',"") + self.name : str = kwargs.get('name',"") """partitioner name""" - self.partitions = kwargs.get('npart', 10) + self.partitions : int = kwargs.get('npart', 10) """The number of universe of discourse partitions, i.e., the number of fuzzy sets that will be created""" - self.sets = {} + self.sets : dict = {} + """The fuzzy sets dictionary""" self.membership_function = kwargs.get('func', Membership.trimf) """Fuzzy membership function (pyFTS.common.Membership)""" - self.setnames = kwargs.get('names', None) + self.setnames : list = kwargs.get('names', None) """list of partitions names. If None is given the partitions will be auto named with prefix""" - self.prefix = kwargs.get('prefix', 'A') + self.prefix : str = kwargs.get('prefix', 'A') """prefix of auto generated partition names""" self.transformation = kwargs.get('transformation', None) """data transformation to be applied on data""" self.indexer = kwargs.get('indexer', None) self.variable = kwargs.get('variable', None) """In a multivariate context, the variable that contains this partitioner""" - self.type = kwargs.get('type', 'common') + self.type : str = kwargs.get('type', 'common') """The type of fuzzy sets that are generated by this partitioner""" - self.ordered_sets = None + self.ordered_sets : list = None """A ordered list of the fuzzy sets names, sorted by their middle point""" - self.kdtree = None + self.kdtree : KDTree = None """A spatial index to help in fuzzyfication""" - self.margin = kwargs.get("margin", 0.1) + self.margin : float = kwargs.get("margin", 0.1) """The upper and lower exceeding margins for the known UoD. The default value is .1""" - self.lower_margin = kwargs.get("lower_margin", self.margin) + self.lower_margin : float = kwargs.get("lower_margin", self.margin) """Specific lower exceeding margins for the known UoD. The default value is the self.margin parameter""" - self.upper_margin = kwargs.get("lower_margin", self.margin) + self.upper_margin : float = kwargs.get("lower_margin", self.margin) """Specific upper exceeding margins for the known UoD. The default value is the self.margin parameter""" if kwargs.get('preprocess',True): @@ -354,7 +341,7 @@ elif s.mf == Membership.singleton: ax.plot([s.parameters[0],s.parameters[0]], [0, s.alpha])
    - def __str__(self): + def __str__(self): """ Return a string representation of the partitioner, the list of fuzzy sets and their parameters @@ -365,7 +352,7 @@ tmp += str(self.sets[key])+ "\n" return tmp - def __len__(self): + def __len__(self): """ Return the number of partitions @@ -373,7 +360,7 @@ """ return self.partitions - def __getitem__(self, item): + def __getitem__(self, item): """ Return a fuzzy set by its order or its name. @@ -393,7 +380,7 @@ raise ValueError("The parameter 'item' must be an integer or a string and the value informed was {} of type {}!".format(item, type(item))) - def __iter__(self): + def __iter__(self): """ Iterate over the fuzzy sets, ordered by its midpoints. @@ -414,7 +401,7 @@

    Quick search

    @@ -433,14 +420,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/probabilistic/ProbabilityDistribution.html b/docs/build/html/_modules/pyFTS/probabilistic/ProbabilityDistribution.html index 0e65d07..9280c12 100644 --- a/docs/build/html/_modules/pyFTS/probabilistic/ProbabilityDistribution.html +++ b/docs/build/html/_modules/pyFTS/probabilistic/ProbabilityDistribution.html @@ -5,31 +5,19 @@ - - pyFTS.probabilistic.ProbabilityDistribution — pyFTS 1.6 documentation - - + + pyFTS.probabilistic.ProbabilityDistribution — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -58,8 +46,8 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt -from pyFTS.common import FuzzySet,SortedCollection,tree -from pyFTS.probabilistic import kde +from pyFTS.common import FuzzySet,SortedCollection,tree +from pyFTS.probabilistic import kde
    [docs]def from_point(x,**kwargs): @@ -81,7 +69,7 @@ If type is histogram, the PDF is discrete If type is KDE the PDF is continuous """ - def __init__(self, type = "KDE", **kwargs): + def __init__(self, type = "KDE", **kwargs): self.uod = kwargs.get("uod", None) """Universe of discourse""" @@ -406,7 +394,7 @@ axis.set_xlabel('Universe of Discourse') axis.set_ylabel('Probability')
    - def __str__(self): + def __str__(self): ret = "" for k in sorted(self.bins): ret += str(round(k,2)) + ':\t' @@ -430,7 +418,7 @@

    Quick search

    @@ -449,14 +437,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_modules/pyFTS/probabilistic/kde.html b/docs/build/html/_modules/pyFTS/probabilistic/kde.html index d8971b3..dee879e 100644 --- a/docs/build/html/_modules/pyFTS/probabilistic/kde.html +++ b/docs/build/html/_modules/pyFTS/probabilistic/kde.html @@ -5,31 +5,19 @@ - - pyFTS.probabilistic.kde — pyFTS 1.6 documentation - - + + pyFTS.probabilistic.kde — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - + @@ -61,13 +49,13 @@ Kernel Density Estimation """ -from pyFTS.common import Transformations +from pyFTS.common import Transformations import numpy as np
    [docs]class KernelSmoothing(object): """Kernel Density Estimation""" - def __init__(self, **kwargs): + def __init__(self, **kwargs): self.h = kwargs.get('h',.5) """Width parameter""" self.kernel = kwargs.get("kernel", "epanechnikov") @@ -137,7 +125,7 @@

    Quick search

    @@ -156,14 +144,14 @@
  • modules |
  • - +
    \ No newline at end of file diff --git a/docs/build/html/_static/basic.css b/docs/build/html/_static/basic.css index 295d6da..bd473cd 100644 --- a/docs/build/html/_static/basic.css +++ b/docs/build/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -130,7 +130,7 @@ ul.search li a { font-weight: bold; } -ul.search li div.context { +ul.search li p.context { color: #888; margin: 2px 0 0 30px; text-align: left; @@ -277,25 +277,25 @@ p.rubric { font-weight: bold; } -img.align-left, .figure.align-left, object.align-left { +img.align-left, figure.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } -img.align-right, .figure.align-right, object.align-right { +img.align-right, figure.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } -img.align-center, .figure.align-center, object.align-center { +img.align-center, figure.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } -img.align-default, .figure.align-default { +img.align-default, figure.align-default, .figure.align-default { display: block; margin-left: auto; margin-right: auto; @@ -319,7 +319,8 @@ img.align-default, .figure.align-default { /* -- sidebars -------------------------------------------------------------- */ -div.sidebar { +div.sidebar, +aside.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; padding: 7px; @@ -377,12 +378,14 @@ div.body p.centered { /* -- content of sidebars/topics/admonitions -------------------------------- */ div.sidebar > :last-child, +aside.sidebar > :last-child, div.topic > :last-child, div.admonition > :last-child { margin-bottom: 0; } div.sidebar::after, +aside.sidebar::after, div.topic::after, div.admonition::after, blockquote::after { @@ -455,20 +458,22 @@ td > :last-child { /* -- figures --------------------------------------------------------------- */ -div.figure { +div.figure, figure { margin: 0.5em; padding: 0.5em; } -div.figure p.caption { +div.figure p.caption, figcaption { padding: 0.3em; } -div.figure p.caption span.caption-number { +div.figure p.caption span.caption-number, +figcaption span.caption-number { font-style: italic; } -div.figure p.caption span.caption-text { +div.figure p.caption span.caption-text, +figcaption span.caption-text { } /* -- field list styles ----------------------------------------------------- */ @@ -503,6 +508,63 @@ table.hlist td { vertical-align: top; } +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + /* -- other body styles ----------------------------------------------------- */ @@ -629,14 +691,6 @@ dl.glossary dt { font-size: 1.1em; } -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - .versionmodified { font-style: italic; } @@ -677,8 +731,9 @@ dl.glossary dt { .classifier:before { font-style: normal; - margin: 0.5em; + margin: 0 0.5em; content: ":"; + display: inline-block; } abbr, acronym { @@ -693,7 +748,7 @@ pre { overflow-y: hidden; /* fixes display issues on Chrome browsers */ } -pre, div[class|="highlight"] { +pre, div[class*="highlight-"] { clear: both; } @@ -702,9 +757,10 @@ span.pre { -ms-hyphens: none; -webkit-hyphens: none; hyphens: none; + white-space: nowrap; } -div[class^="highlight-"] { +div[class*="highlight-"] { margin: 1em 0; } @@ -764,8 +820,13 @@ div.code-block-caption code { } table.highlighttable td.linenos, -div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ } div.code-block-caption span.caption-number { @@ -780,16 +841,6 @@ div.literal-block-wrapper { margin: 1em 0; } -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - code.xref, a code { background-color: transparent; font-weight: bold; diff --git a/docs/build/html/_static/bizstyle.js b/docs/build/html/_static/bizstyle.js index d2ec5ee..cce10fb 100644 --- a/docs/build/html/_static/bizstyle.js +++ b/docs/build/html/_static/bizstyle.js @@ -36,6 +36,6 @@ $(window).resize(function(){ $("li.nav-item-0 a").text("Top"); } else { - $("li.nav-item-0 a").text("pyFTS 1.6 documentation"); + $("li.nav-item-0 a").text("pyFTS 1.7 documentation"); } }); \ No newline at end of file diff --git a/docs/build/html/_static/css3-mediaqueries_src.js b/docs/build/html/_static/css3-mediaqueries_src.js index f21dd49..7878620 100644 --- a/docs/build/html/_static/css3-mediaqueries_src.js +++ b/docs/build/html/_static/css3-mediaqueries_src.js @@ -1035,7 +1035,7 @@ domReady(function enableCssMediaQueries() { var vpw = cssHelper.getViewportWidth(); var vph = cssHelper.getViewportHeight(); // check whether vp size has really changed, because IE also triggers resize event when body size changes - // 20px allowance to accomodate short appearance of scrollbars in IE in some cases + // 20px allowance to accommodate short appearance of scrollbars in IE in some cases if (Math.abs(vpw - cvpw) > scrollbarWidth || Math.abs(vph - cvph) > scrollbarWidth) { cvpw = vpw; cvph = vph; diff --git a/docs/build/html/_static/doctools.js b/docs/build/html/_static/doctools.js index daccd20..e1bfd70 100644 --- a/docs/build/html/_static/doctools.js +++ b/docs/build/html/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -29,9 +29,14 @@ if (!window.console || !console.firebug) { /** * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL */ jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); }; /** @@ -149,9 +154,7 @@ var Documentation = { this.fixFirefoxAnchorBug(); this.highlightSearchWords(); this.initIndexTable(); - if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { - this.initOnKeyListeners(); - } + this.initOnKeyListeners(); }, /** @@ -259,6 +262,16 @@ var Documentation = { hideSearchWords : function() { $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); + var url = new URL(window.location); + url.searchParams.delete('highlight'); + window.history.replaceState({}, '', url); + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar : function() { + $('input[name=q]').first().focus(); }, /** @@ -283,24 +296,54 @@ var Documentation = { }, initOnKeyListeners: function() { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) + return; + $(document).keydown(function(event) { var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea + // don't navigate when in search box, textarea, dropdown or button if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' - && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } + && activeElementType !== 'BUTTON') { + if (event.altKey || event.ctrlKey || event.metaKey) + return; + + if (!event.shiftKey) { + switch (event.key) { + case 'ArrowLeft': + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) + break; + var prevHref = $('link[rel="prev"]').prop('href'); + if (prevHref) { + window.location.href = prevHref; + return false; + } + break; + case 'ArrowRight': + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) + break; + var nextHref = $('link[rel="next"]').prop('href'); + if (nextHref) { + window.location.href = nextHref; + return false; + } + break; + case 'Escape': + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) + break; + Documentation.hideSearchWords(); + return false; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case '/': + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) + break; + Documentation.focusSearchBar(); + return false; } } }); diff --git a/docs/build/html/_static/documentation_options.js b/docs/build/html/_static/documentation_options.js index 4ce91d0..3d8bc76 100644 --- a/docs/build/html/_static/documentation_options.js +++ b/docs/build/html/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '1.6', + VERSION: '1.7', LANGUAGE: 'None', COLLAPSE_INDEX: false, BUILDER: 'html', @@ -8,5 +8,7 @@ var DOCUMENTATION_OPTIONS = { LINK_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, }; \ No newline at end of file diff --git a/docs/build/html/_static/language_data.js b/docs/build/html/_static/language_data.js index d2b4ee9..ebe2f03 100644 --- a/docs/build/html/_static/language_data.js +++ b/docs/build/html/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,8 @@ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; -/* Non-minified version JS is _stemmer.js if file is provided */ +/* Non-minified version is copied as a separate JS file, is available */ + /** * Porter Stemmer */ @@ -199,7 +200,6 @@ var Stemmer = function() { - var splitChars = (function() { var result = {}; var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, diff --git a/docs/build/html/_static/searchtools.js b/docs/build/html/_static/searchtools.js index ab56499..0a44e85 100644 --- a/docs/build/html/_static/searchtools.js +++ b/docs/build/html/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -59,10 +59,10 @@ var Search = { _pulse_status : -1, htmlToText : function(htmlString) { - var htmlElement = document.createElement('span'); - htmlElement.innerHTML = htmlString; - $(htmlElement).find('.headerlink').remove(); - docContent = $(htmlElement).find('[role=main]')[0]; + var virtualDocument = document.implementation.createHTMLDocument('virtual'); + var htmlElement = $(htmlString, virtualDocument); + htmlElement.find('.headerlink').remove(); + docContent = htmlElement.find('[role=main]')[0]; if(docContent === undefined) { console.warn("Content block not found. Sphinx search tries to obtain it " + "via '[role=main]'. Could you check your theme or template."); @@ -166,17 +166,12 @@ var Search = { objectterms.push(tmp[i].toLowerCase()); } - if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) || - tmp[i] === "") { + if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i] === "") { // skip this "word" continue; } // stem the word var word = stemmer.stemWord(tmp[i].toLowerCase()); - // prevent stemmer from cutting word smaller than two chars - if(word.length < 3 && tmp[i].length >= 3) { - word = tmp[i]; - } var toAppend; // select the correct list if (word[0] == '-') { @@ -249,7 +244,7 @@ var Search = { // results left, load the summary and display it if (results.length) { var item = results.pop(); - var listItem = $('
  • '); + var listItem = $('
  • '); var requestUrl = ""; var linkUrl = ""; if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') { @@ -274,28 +269,31 @@ var Search = { if (item[3]) { listItem.append($(' (' + item[3] + ')')); Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); - } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { + }, 5); + } else if (DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY) { $.ajax({url: requestUrl, dataType: "text", complete: function(jqxhr, textstatus) { var data = jqxhr.responseText; if (data !== '' && data !== undefined) { - listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); + var summary = Search.makeSearchSummary(data, searchterms, hlterms); + if (summary) { + listItem.append(summary); + } } Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); }}); } else { - // no source available, just display title + // just display title Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); } } // search finished, update title and status message @@ -326,7 +324,9 @@ var Search = { var results = []; for (var prefix in objects) { - for (var name in objects[prefix]) { + for (var iMatch = 0; iMatch != objects[prefix].length; ++iMatch) { + var match = objects[prefix][iMatch]; + var name = match[4]; var fullname = (prefix ? prefix + '.' : '') + name; var fullnameLower = fullname.toLowerCase() if (fullnameLower.indexOf(object) > -1) { @@ -340,7 +340,6 @@ var Search = { } else if (parts[parts.length - 1].indexOf(object) > -1) { score += Scorer.objPartialMatch; } - var match = objects[prefix][name]; var objname = objnames[match[1]][2]; var title = titles[match[0]]; // If more than one term searched for, we require other words to be @@ -380,6 +379,13 @@ var Search = { return results; }, + /** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions + */ + escapeRegExp : function(string) { + return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string + }, + /** * search for full-text terms in the index */ @@ -403,13 +409,14 @@ var Search = { ]; // add support for partial matches if (word.length > 2) { + var word_regex = this.escapeRegExp(word); for (var w in terms) { - if (w.match(word) && !terms[word]) { + if (w.match(word_regex) && !terms[word]) { _o.push({files: terms[w], score: Scorer.partialTerm}) } } for (var w in titleterms) { - if (w.match(word) && !titleterms[word]) { + if (w.match(word_regex) && !titleterms[word]) { _o.push({files: titleterms[w], score: Scorer.partialTitle}) } } @@ -491,6 +498,9 @@ var Search = { */ makeSearchSummary : function(htmlText, keywords, hlwords) { var text = Search.htmlToText(htmlText); + if (text == "") { + return null; + } var textLower = text.toLowerCase(); var start = 0; $.each(keywords, function() { @@ -502,7 +512,7 @@ var Search = { var excerpt = ((start > 0) ? '...' : '') + $.trim(text.substr(start, 240)) + ((start + 240 - text.length) ? '...' : ''); - var rv = $('
    ').text(excerpt); + var rv = $('

    ').text(excerpt); $.each(hlwords, function() { rv = rv.highlightText(this, 'highlighted'); }); diff --git a/docs/build/html/_static/underscore.js b/docs/build/html/_static/underscore.js index 5b55f32..cf177d4 100644 --- a/docs/build/html/_static/underscore.js +++ b/docs/build/html/_static/underscore.js @@ -1,31 +1,6 @@ -// Underscore.js 1.3.1 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, -h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= -b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== -null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= -function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= -e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, -c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; -b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, -1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; -b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; -b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), -function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ -u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= -function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= -true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ +// Underscore.js 1.13.1 +// https://underscorejs.org +// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +var n="1.13.1",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},Cn=Ln($n),Kn=Ln(_n($n)),Jn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Gn=/(.)^/,Hn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qn=/\\|'|\r|\n|\u2028|\u2029/g;function Xn(n){return"\\"+Hn[n]}var Yn=/^\s*(\w|\$)+\s*$/;var Zn=0;function nr(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var rr=j((function(n,r){var t=rr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)ur(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var lr=rr(cr,2);function sr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Fn(t,u,4),e,o)}}var Ar=wr(1),xr=wr(-1);function Sr(n,r,t){var e=[];return r=qn(r,t),jr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Or(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0;o=0}var Br=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),_r(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Nr(n,r){return _r(n,Rn(r))}function Ir(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ao&&(o=e);else r=qn(r,t),jr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Tr(n,r,t){if(null==r||t)return er(n)||(n=jn(n)),n[Wn(n.length-1)];var e=er(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Fn(e,r[1])),r=an(n)):(e=qr,r=ur(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=_r(ur(r,!1,!1),String),e=function(n,t){return!Er(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=ur(r,!0,!0),Sr(n,(function(n){return!Er(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=zn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=zn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return rr(r,n)},negate:fr,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:cr,once:lr,findKey:sr,findIndex:vr,findLastIndex:hr,sortedIndex:yr,indexOf:gr,lastIndexOf:br,find:mr,detect:mr,findWhere:function(n,r){return mr(n,Dn(r))},each:jr,forEach:jr,map:_r,collect:_r,reduce:Ar,foldl:Ar,inject:Ar,reduceRight:xr,foldr:xr,filter:Sr,select:Sr,reject:function(n,r,t){return Sr(n,fr(qn(r)),t)},every:Or,all:Or,some:Mr,any:Mr,contains:Er,includes:Er,include:Er,invoke:Br,pluck:Nr,where:function(n,r){return Sr(n,Dn(r))},max:Ir,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t - - Index — pyFTS 1.6 documentation - - + + Index — pyFTS 1.7 documentation + + - + - - + @@ -43,7 +31,7 @@
  • modules |
  • - +
    @@ -98,12 +86,78 @@
  • alpha_cut (pyFTS.common.fts.FTS attribute)
  • analytic_tabular_dataframe() (in module pyFTS.benchmarks.Util) @@ -202,8 +256,12 @@
  • (pyFTS.common.transformations.roi.ROI method)
  • (pyFTS.common.transformations.scale.Scale method) +
  • +
  • (pyFTS.common.transformations.smoothing.AveragePooling method)
  • (pyFTS.common.transformations.smoothing.ExponentialSmoothing method) +
  • +
  • (pyFTS.common.transformations.smoothing.MaxPooling method)
  • (pyFTS.common.transformations.smoothing.MovingAverage method)
  • @@ -241,10 +299,70 @@
  • auto_update (pyFTS.common.fts.FTS attribute)
  • averageloglikelihood() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method) +
  • +
  • AveragePooling (class in pyFTS.common.transformations.smoothing)
  • @@ -263,7 +381,71 @@
  • bellmf() (in module pyFTS.common.Membership)
  • benchmark_only (pyFTS.common.fts.FTS attribute) + +
  • + + - - - - + @@ -603,7 +911,69 @@
  • flrg_rhs_conditional_probability() (pyFTS.models.pwfts.ProbabilisticWeightedFTS method)
  • flrgs (pyFTS.common.fts.FTS attribute) + +
  • FLRGTree (class in pyFTS.common.tree)
  • FLRGTreeNode (class in pyFTS.common.tree) @@ -678,6 +1048,8 @@
  • (pyFTS.models.seasonal.msfts.MultiSeasonalFTS method)
  • + + - + - - -
  • is_clustered (pyFTS.common.fts.FTS attribute) + +
  • is_high_order (pyFTS.common.fts.FTS attribute) + +
  • + +

    K

    + - - + @@ -1492,8 +2586,28 @@
  • mape_interval() (in module pyFTS.benchmarks.Measures)
  • -
  • margin (pyFTS.partitioners.partitioner.Partitioner attribute) +
  • margin (pyFTS.partitioners.CMeans.CMeansPartitioner attribute) + +
  • mask (pyFTS.models.multivariate.variable.Variable attribute)
      @@ -1501,6 +2615,70 @@
  • max_lag (pyFTS.common.fts.FTS attribute) + +
  • +
  • MaxPooling (class in pyFTS.common.transformations.smoothing)
  • membership() (in module pyFTS.partitioners.FCM) @@ -1523,7 +2701,69 @@
  • mf (pyFTS.common.FuzzySet.FuzzySet attribute)
  • min_order (pyFTS.common.fts.FTS attribute) + +
  • minute (pyFTS.models.seasonal.common.DateTime attribute)
  • minute_of_day (pyFTS.models.seasonal.common.DateTime attribute) @@ -1665,8 +2905,6 @@
  • pyFTS.data.TAIEX
  • pyFTS.distributed -
  • -
  • pyFTS.distributed.dispy
  • pyFTS.hyperparam
  • @@ -1833,14 +3071,100 @@ - +
    +
  • ordered_sets (pyFTS.partitioners.CMeans.CMeansPartitioner attribute) + +
  • orders (pyFTS.models.ensemble.ensemble.SimpleEnsembleFTS attribute)
  • original_max (pyFTS.common.fts.FTS attribute) + +
  • +
    @@ -1898,15 +3426,19 @@
  • parameters (pyFTS.common.FuzzySet.FuzzySet attribute)
  • -
  • parameters() (pyFTS.common.transformations.boxcox.BoxCox property) - -
  • partition_function() (pyFTS.common.FuzzySet.FuzzySet method) @@ -1920,9 +3452,67 @@
  • partitioner (pyFTS.common.fts.FTS attribute)
  • partitioner_method (pyFTS.models.ensemble.ensemble.SimpleEnsembleFTS attribute) @@ -1942,7 +3532,25 @@
  • partitions (pyFTS.models.ensemble.ensemble.SimpleEnsembleFTS attribute)
  • paths() (pyFTS.common.tree.FLRGTreeNode method) @@ -2053,8 +3661,28 @@
  • predict() (pyFTS.common.fts.FTS method)
  • -
  • prefix (pyFTS.partitioners.partitioner.Partitioner attribute) +
  • prefix (pyFTS.partitioners.CMeans.CMeansPartitioner attribute) + +
  • PreFixedGridPartitioner (class in pyFTS.partitioners.Grid)
  • print_distribution_statistics() (in module pyFTS.benchmarks.benchmarks) @@ -2275,6 +3903,8 @@
  • module
  • + +
    • pyFTS.common.transformations.roi @@ -2366,8 +3996,6 @@
    • module
    - - + - -
  • transformations (pyFTS.common.fts.FTS attribute) + +
  • + +
    \ No newline at end of file diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 5568c99..dcafdf4 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -5,32 +5,20 @@ - - pyFTS - Fuzzy Time Series for Python — pyFTS 1.6 documentation - - + + pyFTS - Fuzzy Time Series for Python — pyFTS 1.7 documentation + + - + - - + @@ -47,7 +35,7 @@
  • next |
  • - +
    @@ -90,7 +78,7 @@ src="http://www.ifmg.edu.br/portal/imagens/logovertical.jpg" alt="IFMG" width="1
    -

    API Documentation:

    +

    API Documentation:

    \ No newline at end of file diff --git a/docs/build/html/pyFTS.benchmarks.html b/docs/build/html/pyFTS.benchmarks.html index 2454ef6..7ba1675 100644 --- a/docs/build/html/pyFTS.benchmarks.html +++ b/docs/build/html/pyFTS.benchmarks.html @@ -5,33 +5,21 @@ - - pyFTS.benchmarks package — pyFTS 1.6 documentation - - + + pyFTS.benchmarks package — pyFTS 1.7 documentation + + - + - - + @@ -51,7 +39,7 @@
  • previous |
  • - + @@ -76,43 +64,38 @@

    pyFTS.benchmarks.benchmarks module

    Benchmarks methods for FTS methods

    -
    -pyFTS.benchmarks.benchmarks.SelecaoSimples_MenorRMSE(original, parameters, modelo)[source]
    +
    +pyFTS.benchmarks.benchmarks.common_process_interval_jobs(conn, data, job)[source]
    -
    -pyFTS.benchmarks.benchmarks.common_process_interval_jobs(conn, data, job)[source]
    +
    +pyFTS.benchmarks.benchmarks.common_process_point_jobs(conn, data, job)[source]
    -
    -pyFTS.benchmarks.benchmarks.common_process_point_jobs(conn, data, job)[source]
    +
    +pyFTS.benchmarks.benchmarks.common_process_probabilistic_jobs(conn, data, job)[source]
    -
    -pyFTS.benchmarks.benchmarks.common_process_probabilistic_jobs(conn, data, job)[source]
    +
    +pyFTS.benchmarks.benchmarks.common_process_time_jobs(conn, data, job)[source]
    -
    -pyFTS.benchmarks.benchmarks.common_process_time_jobs(conn, data, job)[source]
    +
    +pyFTS.benchmarks.benchmarks.compareModelsPlot(original, models_fo, models_ho)[source]
    -
    -pyFTS.benchmarks.benchmarks.compareModelsPlot(original, models_fo, models_ho)[source]
    +
    +pyFTS.benchmarks.benchmarks.compareModelsTable(original, models_fo, models_ho)[source]
    -
    -pyFTS.benchmarks.benchmarks.compareModelsTable(original, models_fo, models_ho)[source]
    -
    - -
    -
    -pyFTS.benchmarks.benchmarks.distributed_model_train_test_time(models, data, windowsize, train=0.8, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.distributed_model_train_test_time(models, data, windowsize, train=0.8, **kwargs)[source]

    Assess the train and test times for a given list of configured models and save the results on a database.

    Parameters
    @@ -131,80 +114,80 @@
    -
    -pyFTS.benchmarks.benchmarks.get_benchmark_interval_methods()[source]
    +
    +pyFTS.benchmarks.benchmarks.get_benchmark_interval_methods()[source]

    Return all non FTS methods for point_to_interval forecasting

    -
    -pyFTS.benchmarks.benchmarks.get_benchmark_point_methods()[source]
    +
    +pyFTS.benchmarks.benchmarks.get_benchmark_point_methods()[source]

    Return all non FTS methods for point forecasting

    -
    -pyFTS.benchmarks.benchmarks.get_benchmark_probabilistic_methods()[source]
    +
    +pyFTS.benchmarks.benchmarks.get_benchmark_probabilistic_methods()[source]

    Return all FTS methods for probabilistic forecasting

    -
    -pyFTS.benchmarks.benchmarks.get_interval_methods()[source]
    +
    +pyFTS.benchmarks.benchmarks.get_interval_methods()[source]

    Return all FTS methods for point_to_interval forecasting

    -
    -pyFTS.benchmarks.benchmarks.get_point_methods()[source]
    +
    +pyFTS.benchmarks.benchmarks.get_point_methods()[source]

    Return all FTS methods for point forecasting

    -
    -pyFTS.benchmarks.benchmarks.get_point_multivariate_methods()[source]
    +
    +pyFTS.benchmarks.benchmarks.get_point_multivariate_methods()[source]

    Return all multivariate FTS methods por point forecasting

    -
    -pyFTS.benchmarks.benchmarks.get_probabilistic_methods()[source]
    +
    +pyFTS.benchmarks.benchmarks.get_probabilistic_methods()[source]

    Return all FTS methods for probabilistic forecasting

    -
    -pyFTS.benchmarks.benchmarks.multivariate_sliding_window_benchmarks2(data, windowsize, train=0.8, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.multivariate_sliding_window_benchmarks2(data, windowsize, train=0.8, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.mv_run_interval2(mfts, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.mv_run_interval2(mfts, train_data, test_data, window_key=None, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.mv_run_point2(mfts, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.mv_run_point2(mfts, train_data, test_data, window_key=None, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.mv_run_probabilistic2(mfts, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.mv_run_probabilistic2(mfts, train_data, test_data, window_key=None, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.pftsExploreOrderAndPartitions(data, save=False, file=None)[source]
    +
    +pyFTS.benchmarks.benchmarks.pftsExploreOrderAndPartitions(data, save=False, file=None)[source]
    -
    -pyFTS.benchmarks.benchmarks.plotCompared(original, forecasts, labels, title)[source]
    +
    +pyFTS.benchmarks.benchmarks.plotCompared(original, forecasts, labels, title)[source]
    -
    -pyFTS.benchmarks.benchmarks.plot_compared_series(original, models, colors, typeonlegend=False, save=False, file=None, tam=[20, 5], points=True, intervals=True, linewidth=1.5)[source]
    +
    +pyFTS.benchmarks.benchmarks.plot_compared_series(original, models, colors, typeonlegend=False, save=False, file=None, tam=[20, 5], points=True, intervals=True, linewidth=1.5)[source]

    Plot the forecasts of several one step ahead models, by point or by interval

    Parameters
    @@ -228,13 +211,13 @@
    -
    -pyFTS.benchmarks.benchmarks.plot_point(axis, points, order, label, color='red', ls='-', linewidth=1)[source]
    +
    +pyFTS.benchmarks.benchmarks.plot_point(axis, points, order, label, color='red', ls='-', linewidth=1)[source]
    -
    -pyFTS.benchmarks.benchmarks.print_distribution_statistics(original, models, steps, resolution)[source]
    +
    +pyFTS.benchmarks.benchmarks.print_distribution_statistics(original, models, steps, resolution)[source]

    Run probabilistic benchmarks on given models and data and print the results

    Parameters
    @@ -250,8 +233,8 @@
    -
    -pyFTS.benchmarks.benchmarks.print_interval_statistics(original, models)[source]
    +
    +pyFTS.benchmarks.benchmarks.print_interval_statistics(original, models)[source]

    Run interval benchmarks on given models and data and print the results

    Parameters
    @@ -267,8 +250,8 @@
    -
    -pyFTS.benchmarks.benchmarks.print_point_statistics(data, models, externalmodels=None, externalforecasts=None, indexers=None)[source]
    +
    +pyFTS.benchmarks.benchmarks.print_point_statistics(data, models, externalmodels=None, externalforecasts=None, indexers=None)[source]

    Run point benchmarks on given models and data and print the results

    Parameters
    @@ -287,8 +270,8 @@
    -
    -pyFTS.benchmarks.benchmarks.process_interval_jobs(dataset, tag, job, conn)[source]
    +
    +pyFTS.benchmarks.benchmarks.process_interval_jobs(dataset, tag, job, conn)[source]

    Extract information from an dictionary with interval benchmark results and save it on a database

    Parameters
    @@ -306,13 +289,13 @@
    -
    -pyFTS.benchmarks.benchmarks.process_interval_jobs2(dataset, tag, job, conn)[source]
    +
    +pyFTS.benchmarks.benchmarks.process_interval_jobs2(dataset, tag, job, conn)[source]
    -
    -pyFTS.benchmarks.benchmarks.process_point_jobs(dataset, tag, job, conn)[source]
    +
    +pyFTS.benchmarks.benchmarks.process_point_jobs(dataset, tag, job, conn)[source]

    Extract information from a dictionary with point benchmark results and save it on a database

    Parameters
    @@ -330,8 +313,8 @@
    -
    -pyFTS.benchmarks.benchmarks.process_point_jobs2(dataset, tag, job, conn)[source]
    +
    +pyFTS.benchmarks.benchmarks.process_point_jobs2(dataset, tag, job, conn)[source]

    Extract information from a dictionary with point benchmark results and save it on a database

    Parameters
    @@ -349,8 +332,8 @@
    -
    -pyFTS.benchmarks.benchmarks.process_probabilistic_jobs(dataset, tag, job, conn)[source]
    +
    +pyFTS.benchmarks.benchmarks.process_probabilistic_jobs(dataset, tag, job, conn)[source]

    Extract information from an dictionary with probabilistic benchmark results and save it on a database

    Parameters
    @@ -368,8 +351,8 @@
    -
    -pyFTS.benchmarks.benchmarks.process_probabilistic_jobs2(dataset, tag, job, conn)[source]
    +
    +pyFTS.benchmarks.benchmarks.process_probabilistic_jobs2(dataset, tag, job, conn)[source]

    Extract information from an dictionary with probabilistic benchmark results and save it on a database

    Parameters
    @@ -387,8 +370,8 @@
    -
    -pyFTS.benchmarks.benchmarks.run_interval(mfts, partitioner, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.run_interval(mfts, partitioner, train_data, test_data, window_key=None, **kwargs)[source]

    Run the interval forecasting benchmarks

    Parameters
    @@ -409,13 +392,13 @@
    -
    -pyFTS.benchmarks.benchmarks.run_interval2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.run_interval2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.run_point(mfts, partitioner, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.run_point(mfts, partitioner, train_data, test_data, window_key=None, **kwargs)[source]

    Run the point forecasting benchmarks

    Parameters
    @@ -436,13 +419,13 @@
    -
    -pyFTS.benchmarks.benchmarks.run_point2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.run_point2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.run_probabilistic(mfts, partitioner, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.run_probabilistic(mfts, partitioner, train_data, test_data, window_key=None, **kwargs)[source]

    Run the probabilistic forecasting benchmarks

    Parameters
    @@ -465,18 +448,18 @@
    -
    -pyFTS.benchmarks.benchmarks.run_probabilistic2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.run_probabilistic2(fts_method, order, partitioner_method, partitions, transformation, train_data, test_data, window_key=None, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.simpleSearch_RMSE(train, test, model, partitions, orders, save=False, file=None, tam=[10, 15], plotforecasts=False, elev=30, azim=144, intervals=False, parameters=None, partitioner=<class 'pyFTS.partitioners.Grid.GridPartitioner'>, transformation=None, indexer=None)[source]
    +
    +pyFTS.benchmarks.benchmarks.simpleSearch_RMSE(train, test, model, partitions, orders, save=False, file=None, tam=[10, 15], plotforecasts=False, elev=30, azim=144, intervals=False, parameters=None, partitioner=<class 'pyFTS.partitioners.Grid.GridPartitioner'>, transformation=None, indexer=None)[source]
    -
    -pyFTS.benchmarks.benchmarks.sliding_window_benchmarks(data, windowsize, train=0.8, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.sliding_window_benchmarks(data, windowsize, train=0.8, **kwargs)[source]

    Sliding window benchmarks for FTS forecasters.

    For each data window, a train and test datasets will be splitted. For each train split, number of partitions and partitioning method will be created a partitioner model. And for each partitioner, order, @@ -520,13 +503,13 @@ informing the list of dispy nodes on ‘nodes’ parameter.

    -
    -pyFTS.benchmarks.benchmarks.sliding_window_benchmarks2(data, windowsize, train=0.8, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.sliding_window_benchmarks2(data, windowsize, train=0.8, **kwargs)[source]
    -
    -pyFTS.benchmarks.benchmarks.train_test_time(data, windowsize, train=0.8, **kwargs)[source]
    +
    +pyFTS.benchmarks.benchmarks.train_test_time(data, windowsize, train=0.8, **kwargs)[source]
    @@ -534,8 +517,8 @@ informing the list of dispy nodes on ‘nodes’ parameter.

    pyFTS.benchmarks.Measures module

    pyFTS module for common benchmark metrics

    -
    -pyFTS.benchmarks.Measures.TheilsInequality(targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.TheilsInequality(targets, forecasts)[source]

    Theil’s Inequality Coefficient

    Parameters
    @@ -551,8 +534,8 @@ informing the list of dispy nodes on ‘nodes’ parameter.

    -
    -pyFTS.benchmarks.Measures.UStatistic(targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.UStatistic(targets, forecasts)[source]

    Theil’s U Statistic

    Parameters
    @@ -568,8 +551,8 @@ informing the list of dispy nodes on ‘nodes’ parameter.

    -
    -pyFTS.benchmarks.Measures.acf(data, k)[source]
    +
    +pyFTS.benchmarks.Measures.acf(data, k)[source]

    Autocorrelation function estimative

    Parameters
    @@ -585,8 +568,8 @@ informing the list of dispy nodes on ‘nodes’ parameter.

    -
    -pyFTS.benchmarks.Measures.brier_score(targets, densities)[source]
    +
    +pyFTS.benchmarks.Measures.brier_score(targets, densities)[source]

    Brier Score for probabilistic forecasts. Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”. Monthly Weather Review. 78: 1–3.

    @@ -603,14 +586,14 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.coverage(targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.coverage(targets, forecasts)[source]

    Percent of target values that fall inside forecasted interval

    -
    -pyFTS.benchmarks.Measures.crps(targets, densities)[source]
    +
    +pyFTS.benchmarks.Measures.crps(targets, densities)[source]

    Continuous Ranked Probability Score

    Parameters
    @@ -626,8 +609,8 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.get_distribution_ahead_statistics(data, distributions)[source]
    +
    +pyFTS.benchmarks.Measures.get_distribution_ahead_statistics(data, distributions)[source]

    Get CRPS statistic and time for a forecasting model

    Parameters
    @@ -644,8 +627,8 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.get_distribution_statistics(data, model, **kwargs)[source]
    +
    +pyFTS.benchmarks.Measures.get_distribution_statistics(data, model, **kwargs)[source]

    Get CRPS statistic and time for a forecasting model

    Parameters
    @@ -662,8 +645,8 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.get_interval_ahead_statistics(data, intervals, **kwargs)[source]
    +
    +pyFTS.benchmarks.Measures.get_interval_ahead_statistics(data, intervals, **kwargs)[source]

    Condensate all measures for point interval forecasters

    Parameters
    @@ -681,8 +664,8 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.get_interval_statistics(data, model, **kwargs)[source]
    +
    +pyFTS.benchmarks.Measures.get_interval_statistics(data, model, **kwargs)[source]

    Condensate all measures for point interval forecasters

    Parameters
    @@ -700,8 +683,8 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.get_point_ahead_statistics(data, forecasts, **kwargs)[source]
    +
    +pyFTS.benchmarks.Measures.get_point_ahead_statistics(data, forecasts, **kwargs)[source]

    Condensate all measures for point forecasters

    Parameters
    @@ -718,8 +701,8 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.get_point_statistics(data, model, **kwargs)[source]
    +
    +pyFTS.benchmarks.Measures.get_point_statistics(data, model, **kwargs)[source]

    Condensate all measures for point forecasters

    Parameters
    @@ -736,8 +719,8 @@ Brier (1950). “Verification of Forecasts Expressed in Terms of Probability”.
    -
    -pyFTS.benchmarks.Measures.logarithm_score(targets, densities)[source]
    +
    +pyFTS.benchmarks.Measures.logarithm_score(targets, densities)[source]

    Logarithm Score for probabilistic forecasts. Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Society B,14(1),107–114. URLhttps://www.jstor.org/stable/2984087.

    @@ -754,8 +737,8 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Measures.mape(targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.mape(targets, forecasts)[source]

    Mean Average Percentual Error

    Parameters
    @@ -771,13 +754,19 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Measures.mape_interval(targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.mape_interval(targets, forecasts)[source]
    -
    -pyFTS.benchmarks.Measures.pinball(tau, target, forecast)[source]
    +
    +pyFTS.benchmarks.Measures.nmrse(targets, forecasts, order=0, offset=0)[source]
    +

    Normalized Root Mean Squared Error

    +
    + +
    +
    +pyFTS.benchmarks.Measures.pinball(tau, target, forecast)[source]

    Pinball loss function. Measure the distance of forecast to the tau-quantile of the target

    Parameters
    @@ -794,8 +783,8 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Measures.pinball_mean(tau, targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.pinball_mean(tau, targets, forecasts)[source]

    Mean pinball loss value of the forecast for a given tau-quantile of the targets

    Parameters
    @@ -812,14 +801,33 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Measures.resolution(forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.resolution(forecasts)[source]

    Resolution - Standard deviation of the intervals

    -
    -pyFTS.benchmarks.Measures.rmse(targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.rmse(targets, forecasts, order=0, offset=0)[source]
    +

    Root Mean Squared Error

    +
    +
    Parameters
    +
      +
    • targets – array of targets

    • +
    • forecasts – array of forecasts

    • +
    • order – model order

    • +
    • offset – forecast offset related to target.

    • +
    +
    +
    Returns
    +

    +
    +
    +
    + +
    +
    +pyFTS.benchmarks.Measures.rmse_interval(targets, forecasts)[source]

    Root Mean Squared Error

    Parameters
    @@ -835,31 +843,14 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Measures.rmse_interval(targets, forecasts)[source]
    -

    Root Mean Squared Error

    -
    -
    Parameters
    -
      -
    • targets

    • -
    • forecasts

    • -
    -
    -
    Returns
    -

    -
    -
    -
    - -
    -
    -pyFTS.benchmarks.Measures.sharpness(forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.sharpness(forecasts)[source]

    Sharpness - Mean size of the intervals

    -
    -pyFTS.benchmarks.Measures.smape(targets, forecasts, type=2)[source]
    +
    +pyFTS.benchmarks.Measures.smape(targets, forecasts, type=2)[source]

    Symmetric Mean Average Percentual Error

    Parameters
    @@ -876,8 +867,8 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Measures.winkler_mean(tau, targets, forecasts)[source]
    +
    +pyFTS.benchmarks.Measures.winkler_mean(tau, targets, forecasts)[source]

    Mean Winkler score value of the forecast for a given tau-quantile of the targets

    Parameters
    @@ -894,8 +885,8 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Measures.winkler_score(tau, target, forecast)[source]
    +
    +pyFTS.benchmarks.Measures.winkler_score(tau, target, forecast)[source]
      1. Winkler, A Decision-Theoretic Approach to Interval Estimation, J. Am. Stat. Assoc. 67 (337) (1972) 187–191. doi:10.2307/2284720.

      2. @@ -921,8 +912,8 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie

        pyFTS.benchmarks.ResidualAnalysis module

        Residual Analysis methods

        -
        -pyFTS.benchmarks.ResidualAnalysis.compare_residuals(data, models, alpha=0.05)[source]
        +
        +pyFTS.benchmarks.ResidualAnalysis.compare_residuals(data, models, alpha=0.05)[source]

        Compare residual’s statistics of several models

        Parameters
        @@ -938,32 +929,32 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
        -
        -pyFTS.benchmarks.ResidualAnalysis.ljung_box_test(residuals, lags=[1, 2, 3], alpha=0.5)[source]
        +
        +pyFTS.benchmarks.ResidualAnalysis.ljung_box_test(residuals, lags=[1, 2, 3], alpha=0.5)[source]
        -
        -pyFTS.benchmarks.ResidualAnalysis.plot_residuals_by_model(targets, models, tam=[8, 8], save=False, file=None)[source]
        +
        +pyFTS.benchmarks.ResidualAnalysis.plot_residuals_by_model(targets, models, tam=[8, 8], save=False, file=None)[source]
        -
        -pyFTS.benchmarks.ResidualAnalysis.residuals(targets, forecasts, order=1)[source]
        +
        +pyFTS.benchmarks.ResidualAnalysis.residuals(targets, forecasts, order=1)[source]

        First order residuals

        -
        -pyFTS.benchmarks.ResidualAnalysis.single_plot_residuals(res, order, tam=[10, 7], save=False, file=None)[source]
        +
        +pyFTS.benchmarks.ResidualAnalysis.single_plot_residuals(res, order, tam=[10, 7], save=False, file=None)[source]

    pyFTS.benchmarks.Tests module

    -
    -pyFTS.benchmarks.Tests.BoxLjungStatistic(data, h)[source]
    +
    +pyFTS.benchmarks.Tests.BoxLjungStatistic(data, h)[source]

    Q Statistic for Ljung–Box test

    Parameters
    @@ -979,8 +970,8 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Tests.BoxPierceStatistic(data, h)[source]
    +
    +pyFTS.benchmarks.Tests.BoxPierceStatistic(data, h)[source]

    Q Statistic for Box-Pierce test

    Parameters
    @@ -996,13 +987,13 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Tests.format_experiment_table(df, exclude=[], replace={}, csv=True, std=False)[source]
    +
    +pyFTS.benchmarks.Tests.format_experiment_table(df, exclude=[], replace={}, csv=True, std=False)[source]
    -
    -pyFTS.benchmarks.Tests.post_hoc_tests(post_hoc, control_method, alpha=0.05, method='finner')[source]
    +
    +pyFTS.benchmarks.Tests.post_hoc_tests(post_hoc, control_method, alpha=0.05, method='finner')[source]

    Finner paired post-hoc test with NSFTS as control method.

    $H_0$: There is no significant difference between the means

    $H_1$: There is a significant difference between the means

    @@ -1022,8 +1013,8 @@ Good IJ (1952). “Rational Decisions.”Journal of the Royal Statistical Socie
    -
    -pyFTS.benchmarks.Tests.test_mean_equality(tests, alpha=0.05, method='friedman')[source]
    +
    +pyFTS.benchmarks.Tests.test_mean_equality(tests, alpha=0.05, method='friedman')[source]

    Test for the equality of the means, with alpha confidence level.

    H_0: There’s no significant difference between the means H_1: There is at least one significant difference between the means

    @@ -1046,53 +1037,53 @@ H_1: There is at least one significant difference between the means

    pyFTS.benchmarks.Util module

    Facilities for pyFTS Benchmark module

    -
    -pyFTS.benchmarks.Util.analytic_tabular_dataframe(dataframe)[source]
    +
    +pyFTS.benchmarks.Util.analytic_tabular_dataframe(dataframe)[source]
    -
    -pyFTS.benchmarks.Util.analytical_data_columns(experiments)[source]
    +
    +pyFTS.benchmarks.Util.analytical_data_columns(experiments)[source]
    -
    -pyFTS.benchmarks.Util.base_dataframe_columns()[source]
    +
    +pyFTS.benchmarks.Util.base_dataframe_columns()[source]
    -
    -pyFTS.benchmarks.Util.cast_dataframe_to_synthetic(infile, outfile, experiments, type)[source]
    +
    +pyFTS.benchmarks.Util.cast_dataframe_to_synthetic(infile, outfile, experiments, type)[source]
    -
    -pyFTS.benchmarks.Util.cast_dataframe_to_synthetic_interval(df, data_columns)[source]
    +
    +pyFTS.benchmarks.Util.cast_dataframe_to_synthetic_interval(df, data_columns)[source]
    -
    -pyFTS.benchmarks.Util.cast_dataframe_to_synthetic_point(df, data_columns)[source]
    +
    +pyFTS.benchmarks.Util.cast_dataframe_to_synthetic_point(df, data_columns)[source]
    -
    -pyFTS.benchmarks.Util.cast_dataframe_to_synthetic_probabilistic(df, data_columns)[source]
    +
    +pyFTS.benchmarks.Util.cast_dataframe_to_synthetic_probabilistic(df, data_columns)[source]
    -
    -pyFTS.benchmarks.Util.check_ignore_list(b, ignore)[source]
    +
    +pyFTS.benchmarks.Util.check_ignore_list(b, ignore)[source]
    -
    -pyFTS.benchmarks.Util.check_replace_list(m, replace)[source]
    +
    +pyFTS.benchmarks.Util.check_replace_list(m, replace)[source]
    -
    -pyFTS.benchmarks.Util.create_benchmark_tables(conn)[source]
    +
    +pyFTS.benchmarks.Util.create_benchmark_tables(conn)[source]

    Create a sqlite3 table designed to store benchmark results.

    Parameters
    @@ -1102,18 +1093,18 @@ H_1: There is at least one significant difference between the means

    -
    -pyFTS.benchmarks.Util.extract_measure(dataframe, measure, data_columns)[source]
    +
    +pyFTS.benchmarks.Util.extract_measure(dataframe, measure, data_columns)[source]
    -
    -pyFTS.benchmarks.Util.find_best(dataframe, criteria, ascending)[source]
    +
    +pyFTS.benchmarks.Util.find_best(dataframe, criteria, ascending)[source]
    -
    -pyFTS.benchmarks.Util.get_dataframe_from_bd(file, filter)[source]
    +
    +pyFTS.benchmarks.Util.get_dataframe_from_bd(file, filter)[source]

    Query the sqlite benchmark database and return a pandas dataframe with the results

    Parameters
    @@ -1129,8 +1120,8 @@ H_1: There is at least one significant difference between the means

    -
    -pyFTS.benchmarks.Util.insert_benchmark(data, conn)[source]
    +
    +pyFTS.benchmarks.Util.insert_benchmark(data, conn)[source]

    Insert benchmark data on database

    Parameters
    @@ -1162,18 +1153,18 @@ Value: the measure value

    -
    -pyFTS.benchmarks.Util.interval_dataframe_analytic_columns(experiments)[source]
    +
    +pyFTS.benchmarks.Util.interval_dataframe_analytic_columns(experiments)[source]
    -
    -pyFTS.benchmarks.Util.interval_dataframe_synthetic_columns()[source]
    +
    +pyFTS.benchmarks.Util.interval_dataframe_synthetic_columns()[source]
    -
    -pyFTS.benchmarks.Util.open_benchmark_db(name)[source]
    +
    +pyFTS.benchmarks.Util.open_benchmark_db(name)[source]

    Open a connection with a Sqlite database designed to store benchmark results.

    Parameters
    @@ -1186,48 +1177,48 @@ Value: the measure value

    -
    -pyFTS.benchmarks.Util.plot_dataframe_interval(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.plot_dataframe_interval(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    -
    -pyFTS.benchmarks.Util.plot_dataframe_interval_pinball(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.plot_dataframe_interval_pinball(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    -
    -pyFTS.benchmarks.Util.plot_dataframe_point(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['UAVG', 'RMSEAVG', 'USTD', 'RMSESTD'], sort_ascend=[1, 1, 1, 1], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.plot_dataframe_point(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['UAVG', 'RMSEAVG', 'USTD', 'RMSESTD'], sort_ascend=[1, 1, 1, 1], save_best=False, ignore=None, replace=None)[source]
    -
    -pyFTS.benchmarks.Util.plot_dataframe_probabilistic(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['CRPS1AVG', 'CRPS2AVG', 'CRPS1STD', 'CRPS2STD'], sort_ascend=[True, True, True, True], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.plot_dataframe_probabilistic(file_synthetic, file_analytic, experiments, tam, save=False, file=None, sort_columns=['CRPS1AVG', 'CRPS2AVG', 'CRPS1STD', 'CRPS2STD'], sort_ascend=[True, True, True, True], save_best=False, ignore=None, replace=None)[source]
    -
    -pyFTS.benchmarks.Util.point_dataframe_analytic_columns(experiments)[source]
    +
    +pyFTS.benchmarks.Util.point_dataframe_analytic_columns(experiments)[source]
    -
    -pyFTS.benchmarks.Util.point_dataframe_synthetic_columns()[source]
    +
    +pyFTS.benchmarks.Util.point_dataframe_synthetic_columns()[source]
    -
    -pyFTS.benchmarks.Util.probabilistic_dataframe_analytic_columns(experiments)[source]
    +
    +pyFTS.benchmarks.Util.probabilistic_dataframe_analytic_columns(experiments)[source]
    -
    -pyFTS.benchmarks.Util.probabilistic_dataframe_synthetic_columns()[source]
    +
    +pyFTS.benchmarks.Util.probabilistic_dataframe_synthetic_columns()[source]
    -
    -pyFTS.benchmarks.Util.process_common_data(dataset, tag, type, job)[source]
    +
    +pyFTS.benchmarks.Util.process_common_data(dataset, tag, type, job)[source]

    Wraps benchmark information on a tuple for sqlite database

    Parameters
    @@ -1245,8 +1236,8 @@ Value: the measure value

    -
    -pyFTS.benchmarks.Util.process_common_data2(dataset, tag, type, job)[source]
    +
    +pyFTS.benchmarks.Util.process_common_data2(dataset, tag, type, job)[source]

    Wraps benchmark information on a tuple for sqlite database

    Parameters
    @@ -1264,13 +1255,13 @@ Value: the measure value

    -
    -pyFTS.benchmarks.Util.save_dataframe_interval(coverage, experiments, file, objs, resolution, save, sharpness, synthetic, times, q05, q25, q75, q95, steps, method)[source]
    +
    +pyFTS.benchmarks.Util.save_dataframe_interval(coverage, experiments, file, objs, resolution, save, sharpness, synthetic, times, q05, q25, q75, q95, steps, method)[source]
    -
    -pyFTS.benchmarks.Util.save_dataframe_point(experiments, file, objs, rmse, save, synthetic, smape, times, u, steps, method)[source]
    +
    +pyFTS.benchmarks.Util.save_dataframe_point(experiments, file, objs, rmse, save, synthetic, smape, times, u, steps, method)[source]

    Create a dataframe to store the benchmark results

    Parameters
    @@ -1293,8 +1284,8 @@ Value: the measure value

    -
    -pyFTS.benchmarks.Util.save_dataframe_probabilistic(experiments, file, objs, crps, times, save, synthetic, steps, method)[source]
    +
    +pyFTS.benchmarks.Util.save_dataframe_probabilistic(experiments, file, objs, crps, times, save, synthetic, steps, method)[source]

    Save benchmark results for m-step ahead probabilistic forecasters :param experiments: :param file: @@ -1309,18 +1300,18 @@ Value: the measure value

    -
    -pyFTS.benchmarks.Util.scale(data, params)[source]
    +
    +pyFTS.benchmarks.Util.scale(data, params)[source]
    -
    -pyFTS.benchmarks.Util.scale_params(data)[source]
    +
    +pyFTS.benchmarks.Util.scale_params(data)[source]
    -
    -pyFTS.benchmarks.Util.simple_synthetic_dataframe(file, tag, measure, sql=None)[source]
    +
    +pyFTS.benchmarks.Util.simple_synthetic_dataframe(file, tag, measure, sql=None)[source]

    Read experiments results from sqlite3 database in ‘file’, make a synthesis of the results of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFrame with the mean results.

    @@ -1338,51 +1329,51 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -pyFTS.benchmarks.Util.stats(measure, data)[source]
    +
    +pyFTS.benchmarks.Util.stats(measure, data)[source]
    -
    -pyFTS.benchmarks.Util.tabular_dataframe_columns()[source]
    +
    +pyFTS.benchmarks.Util.tabular_dataframe_columns()[source]
    -
    -pyFTS.benchmarks.Util.unified_scaled_interval(experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.unified_scaled_interval(experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    -
    -pyFTS.benchmarks.Util.unified_scaled_interval_pinball(experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.unified_scaled_interval_pinball(experiments, tam, save=False, file=None, sort_columns=['COVAVG', 'SHARPAVG', 'COVSTD', 'SHARPSTD'], sort_ascend=[True, False, True, True], save_best=False, ignore=None, replace=None)[source]
    -
    -pyFTS.benchmarks.Util.unified_scaled_point(experiments, tam, save=False, file=None, sort_columns=['UAVG', 'RMSEAVG', 'USTD', 'RMSESTD'], sort_ascend=[1, 1, 1, 1], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.unified_scaled_point(experiments, tam, save=False, file=None, sort_columns=['UAVG', 'RMSEAVG', 'USTD', 'RMSESTD'], sort_ascend=[1, 1, 1, 1], save_best=False, ignore=None, replace=None)[source]
    -
    -pyFTS.benchmarks.Util.unified_scaled_probabilistic(experiments, tam, save=False, file=None, sort_columns=['CRPSAVG', 'CRPSSTD'], sort_ascend=[True, True], save_best=False, ignore=None, replace=None)[source]
    +
    +pyFTS.benchmarks.Util.unified_scaled_probabilistic(experiments, tam, save=False, file=None, sort_columns=['CRPSAVG', 'CRPSSTD'], sort_ascend=[True, True], save_best=False, ignore=None, replace=None)[source]

    pyFTS.benchmarks.arima module

    -
    -class pyFTS.benchmarks.arima.ARIMA(**kwargs)[source]
    +
    +class pyFTS.benchmarks.arima.ARIMA(**kwargs)[source]

    Bases: pyFTS.common.fts.FTS

    Façade for statsmodels.tsa.arima_model

    -
    -ar(data)[source]
    +
    +ar(data)[source]
    -
    -forecast(ndata, **kwargs)[source]
    +
    +forecast(ndata, **kwargs)[source]

    Point forecast one step ahead

    Parameters
    @@ -1398,8 +1389,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_distribution(data, steps, **kwargs)[source]
    +
    +forecast_ahead_distribution(data, steps, **kwargs)[source]

    Probabilistic forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1416,8 +1407,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_interval(ndata, steps, **kwargs)[source]
    +
    +forecast_ahead_interval(ndata, steps, **kwargs)[source]

    Interval forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1434,8 +1425,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_distribution(data, **kwargs)[source]
    +
    +forecast_distribution(data, **kwargs)[source]

    Probabilistic forecast one step ahead

    Parameters
    @@ -1451,8 +1442,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_interval(data, **kwargs)[source]
    +
    +forecast_interval(data, **kwargs)[source]

    Interval forecast one step ahead

    Parameters
    @@ -1468,13 +1459,13 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -ma(data)[source]
    +
    +ma(data)[source]
    -
    -train(data, **kwargs)[source]
    +
    +train(data, **kwargs)[source]

    Method specific parameter fitting

    Parameters
    @@ -1492,13 +1483,13 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram

    pyFTS.benchmarks.knn module

    -
    -class pyFTS.benchmarks.knn.KNearestNeighbors(**kwargs)[source]
    +
    +class pyFTS.benchmarks.knn.KNearestNeighbors(**kwargs)[source]

    Bases: pyFTS.common.fts.FTS

    A façade for sklearn.neighbors

    -
    -forecast(data, **kwargs)[source]
    +
    +forecast(data, **kwargs)[source]

    Point forecast one step ahead

    Parameters
    @@ -1514,8 +1505,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_distribution(data, steps, **kwargs)[source]
    +
    +forecast_ahead_distribution(data, steps, **kwargs)[source]

    Probabilistic forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1532,8 +1523,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_interval(data, steps, **kwargs)[source]
    +
    +forecast_ahead_interval(data, steps, **kwargs)[source]

    Interval forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1550,8 +1541,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_distribution(data, **kwargs)[source]
    +
    +forecast_distribution(data, **kwargs)[source]

    Probabilistic forecast one step ahead

    Parameters
    @@ -1567,8 +1558,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_interval(data, **kwargs)[source]
    +
    +forecast_interval(data, **kwargs)[source]

    Interval forecast one step ahead

    Parameters
    @@ -1584,13 +1575,13 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -knn(sample)[source]
    +
    +knn(sample)[source]
    -
    -train(data, **kwargs)[source]
    +
    +train(data, **kwargs)[source]

    Method specific parameter fitting

    Parameters
    @@ -1608,13 +1599,13 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram

    pyFTS.benchmarks.naive module

    -
    -class pyFTS.benchmarks.naive.Naive(**kwargs)[source]
    +
    +class pyFTS.benchmarks.naive.Naive(**kwargs)[source]

    Bases: pyFTS.common.fts.FTS

    Naïve Forecasting method

    -
    -forecast(data, **kwargs)[source]
    +
    +forecast(data, **kwargs)[source]

    Point forecast one step ahead

    Parameters
    @@ -1635,13 +1626,13 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram

    pyFTS.benchmarks.quantreg module

    -
    -class pyFTS.benchmarks.quantreg.QuantileRegression(**kwargs)[source]
    +
    +class pyFTS.benchmarks.quantreg.QuantileRegression(**kwargs)[source]

    Bases: pyFTS.common.fts.FTS

    Façade for statsmodels.regression.quantile_regression

    -
    -forecast(ndata, **kwargs)[source]
    +
    +forecast(ndata, **kwargs)[source]

    Point forecast one step ahead

    Parameters
    @@ -1657,8 +1648,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_distribution(ndata, steps, **kwargs)[source]
    +
    +forecast_ahead_distribution(ndata, steps, **kwargs)[source]

    Probabilistic forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1675,8 +1666,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_interval(ndata, steps, **kwargs)[source]
    +
    +forecast_ahead_interval(ndata, steps, **kwargs)[source]

    Interval forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1693,8 +1684,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_distribution(ndata, **kwargs)[source]
    +
    +forecast_distribution(ndata, **kwargs)[source]

    Probabilistic forecast one step ahead

    Parameters
    @@ -1710,8 +1701,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_interval(ndata, **kwargs)[source]
    +
    +forecast_interval(ndata, **kwargs)[source]

    Interval forecast one step ahead

    Parameters
    @@ -1727,23 +1718,23 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -interval_to_interval(data, lo_params, up_params)[source]
    +
    +interval_to_interval(data, lo_params, up_params)[source]
    -
    -linearmodel(data, params)[source]
    +
    +linearmodel(data, params)[source]
    -
    -point_to_interval(data, lo_params, up_params)[source]
    +
    +point_to_interval(data, lo_params, up_params)[source]
    -
    -train(data, **kwargs)[source]
    +
    +train(data, **kwargs)[source]

    Method specific parameter fitting

    Parameters
    @@ -1764,13 +1755,13 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram

    pyFTS.benchmarks.BSTS module

    -
    -class pyFTS.benchmarks.BSTS.ARIMA(**kwargs)[source]
    +
    +class pyFTS.benchmarks.BSTS.ARIMA(**kwargs)[source]

    Bases: pyFTS.common.fts.FTS

    Façade for statsmodels.tsa.arima_model

    -
    -forecast(ndata, **kwargs)[source]
    +
    +forecast(ndata, **kwargs)[source]

    Point forecast one step ahead

    Parameters
    @@ -1786,8 +1777,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead(data, steps, **kwargs)[source]
    +
    +forecast_ahead(data, steps, **kwargs)[source]

    Point forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1804,8 +1795,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_distribution(data, steps, **kwargs)[source]
    +
    +forecast_ahead_distribution(data, steps, **kwargs)[source]

    Probabilistic forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1822,8 +1813,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_ahead_interval(ndata, steps, **kwargs)[source]
    +
    +forecast_ahead_interval(ndata, steps, **kwargs)[source]

    Interval forecast from 1 to H steps ahead, where H is given by the steps parameter

    Parameters
    @@ -1840,8 +1831,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_distribution(data, **kwargs)[source]
    +
    +forecast_distribution(data, **kwargs)[source]

    Probabilistic forecast one step ahead

    Parameters
    @@ -1857,8 +1848,8 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -forecast_interval(data, **kwargs)[source]
    +
    +forecast_interval(data, **kwargs)[source]

    Interval forecast one step ahead

    Parameters
    @@ -1874,13 +1865,13 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram
    -
    -inference(steps)[source]
    +
    +inference(steps)[source]
    -
    -train(data, **kwargs)[source]
    +
    +train(data, **kwargs)[source]

    Method specific parameter fitting

    Parameters
    @@ -1904,8 +1895,9 @@ of the metric ‘measure’ with the same ‘tag’, returning a Pandas DataFram