From f63b582b30d81dc8c7c453ec4e05d15b18383c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido?= Date: Fri, 12 Apr 2019 11:48:19 -0300 Subject: [PATCH] GranularWMVFTS --- pyFTS/models/multivariate/cmvfts.py | 2 +- pyFTS/models/multivariate/granular.py | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pyFTS/models/multivariate/granular.py diff --git a/pyFTS/models/multivariate/cmvfts.py b/pyFTS/models/multivariate/cmvfts.py index 1f5db04..173be22 100644 --- a/pyFTS/models/multivariate/cmvfts.py +++ b/pyFTS/models/multivariate/cmvfts.py @@ -8,7 +8,7 @@ from pyFTS.models.multivariate import mvfts, grid, common class ClusteredMVFTS(mvfts.MVFTS): """ - Meta model for multivariate, high order, clustered multivariate FTS + Meta model for high order, clustered multivariate FTS """ def __init__(self, **kwargs): super(ClusteredMVFTS, self).__init__(**kwargs) diff --git a/pyFTS/models/multivariate/granular.py b/pyFTS/models/multivariate/granular.py new file mode 100644 index 0000000..c9dbbdb --- /dev/null +++ b/pyFTS/models/multivariate/granular.py @@ -0,0 +1,26 @@ +from pyFTS.models.multivariate import cmvfts, grid +from pyFTS.models import hofts + + +class GranularWMVFTS(cmvfts.ClusteredMVFTS): + """ + Granular multivariate weighted high order FTS + """ + + def __init__(self, **kwargs): + super(GranularWMVFTS, self).__init__(**kwargs) + + self.fts_method = hofts.WeightedHighOrderFTS + self.model = None + """The most recent trained model""" + self.knn = kwargs.get('knn', 2) + self.order = kwargs.get("order", 2) + self.shortname = "GranularWMVFTS" + self.name = "Granular Weighted Multivariate FTS" + + def train(self, data, **kwargs): + self.partitioner = grid.IncrementalGridCluster( + explanatory_variables=self.explanatory_variables, + target_variable=self.target_variable) + super.train(data,**kwargs) +