Small bugfix in GranularWMVFTS
This commit is contained in:
parent
7319bce515
commit
d2725a94aa
@ -44,9 +44,9 @@ class ClusteredMVFTS(mvfts.MVFTS):
|
||||
|
||||
def train(self, data, **kwargs):
|
||||
|
||||
self.fts_params['order'] = self.order
|
||||
|
||||
self.model = self.fts_method(partitioner=self.partitioner, **self.fts_params)
|
||||
if self.model.is_high_order:
|
||||
self.model.order = self.order
|
||||
|
||||
ndata = self.check_data(data)
|
||||
|
||||
|
@ -21,6 +21,7 @@ class GranularWMVFTS(cmvfts.ClusteredMVFTS):
|
||||
def train(self, data, **kwargs):
|
||||
self.partitioner = grid.IncrementalGridCluster(
|
||||
explanatory_variables=self.explanatory_variables,
|
||||
target_variable=self.target_variable)
|
||||
target_variable=self.target_variable,
|
||||
neighbors=self.knn)
|
||||
super(GranularWMVFTS, self).train(data,**kwargs)
|
||||
|
||||
|
@ -186,14 +186,13 @@ vavg = variable.Variable("Radiation", data_label="glo_avg", alias='rad',
|
||||
partitioner=Grid.GridPartitioner, npart=25, alpha_cut=.3,
|
||||
data=train)
|
||||
|
||||
from pyFTS.models.multivariate import mvfts, wmvfts, cmvfts, grid
|
||||
from pyFTS.models.multivariate import mvfts, wmvfts, cmvfts, grid, granular
|
||||
|
||||
fs = grid.GridCluster(explanatory_variables=[vmonth, vhour, vavg], target_variable=vavg)
|
||||
|
||||
|
||||
model = cmvfts.ClusteredMVFTS(explanatory_variables=[vmonth, vhour, vavg], target_variable=vavg,
|
||||
partitioner=fs, knn=3)
|
||||
model = granular.GranularWMVFTS(explanatory_variables=[vmonth, vhour, vavg], target_variable=vavg,
|
||||
order=2, knn=7)
|
||||
|
||||
model.fit(train)
|
||||
|
||||
model.predict(test)
|
||||
print(model)
|
||||
|
||||
#model.predict(test)
|
||||
|
Loading…
Reference in New Issue
Block a user