Source code for pyFTS.models.multivariate.variable

-from pyFTS.common import fts, FuzzySet, FLR, Membership, tree
+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
 
@@ -98,6 +99,10 @@
         self.data_label = kwargs.get('data_label', self.name)
         """A string with the column name on DataFrame"""
         self.type = kwargs.get('type', 'common')
+        self.data_type = kwargs.get('data_type', None)
+        """The type of the data column on Pandas Dataframe"""
+        self.mask = kwargs.get('mask', None)
+        """The mask for format the data column on Pandas Dataframe"""
         self.transformation = kwargs.get('transformation', None)
         self.transformation_params = kwargs.get('transformation_params', None)
         self.partitioner = None
diff --git a/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html b/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html
index 5f09113..753ea68 100644
--- a/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html
+++ b/docs/build/html/_modules/pyFTS/models/multivariate/wmvfts.html
@@ -94,11 +94,12 @@
         self.w = None
 
 
[docs] def append_rhs(self, fset, **kwargs): + count = kwargs.get('count', 1.0) if fset not in self.RHS: - self.RHS[fset] = 1.0 + self.RHS[fset] = count else: - self.RHS[fset] += 1.0 - self.count += 1.0
+ self.RHS[fset] += count + self.count += count
[docs] def weights(self): if self.w is None: @@ -125,10 +126,6 @@ """ def __init__(self, **kwargs): super(WeightedMVFTS, self).__init__(order=1, **kwargs) - self.explanatory_variables = [] - self.target_variable = None - self.flrgs = {} - self.is_multivariate = True self.shortname = "WeightedMVFTS" self.name = "Weighted Multivariate FTS" diff --git a/docs/build/html/_modules/pyFTS/models/pwfts.html b/docs/build/html/_modules/pyFTS/models/pwfts.html index 8d4c2f7..fb9e1a2 100644 --- a/docs/build/html/_modules/pyFTS/models/pwfts.html +++ b/docs/build/html/_modules/pyFTS/models/pwfts.html @@ -90,25 +90,23 @@ def __init__(self, order): super(ProbabilisticWeightedFLRG, self).__init__(order) self.RHS = {} - self.rhs_count = {} self.frequency_count = 0.0 self.Z = None
[docs] def get_membership(self, data, sets): - if isinstance(data, (np.ndarray, list)): + if isinstance(data, (np.ndarray, list, tuple, set)): return np.nanprod([sets[key].membership(data[count]) for count, key in enumerate(self.LHS, start=0)]) else: return sets[self.LHS[0]].membership(data)
[docs] def append_rhs(self, c, **kwargs): - mv = kwargs.get('mv', 1.0) - self.frequency_count += mv + count = kwargs.get('count', 1.0) + self.frequency_count += count if c in self.RHS: - self.rhs_count[c] += mv + self.RHS[c] += count else: - self.RHS[c] = c - self.rhs_count[c] = mv
+ self.RHS[c] = count
[docs] def lhs_conditional_probability(self, x, sets, norm, uod, nbins): pk = self.frequency_count / norm @@ -118,11 +116,11 @@ return tmp
[docs] def rhs_unconditional_probability(self, c): - return self.rhs_count[c] / self.frequency_count
+ return self.RHS[c] / self.frequency_count