Small bugfix in GranularWMVFTS
This commit is contained in:
parent
dca52fb9ed
commit
7319bce515
@ -54,7 +54,7 @@ def fuzzyfy_instance_clustered(data_point, cluster, **kwargs):
|
||||
alpha_cut = kwargs.get('alpha_cut', 0.0)
|
||||
mode = kwargs.get('mode', 'sets')
|
||||
fsets = []
|
||||
for fset in cluster.search(data_point):
|
||||
for fset in cluster.search(data_point, type='name'):
|
||||
if cluster.sets[fset].membership(data_point) > alpha_cut:
|
||||
if mode == 'sets':
|
||||
fsets.append(fset)
|
||||
|
@ -48,13 +48,9 @@ class IncrementalGridCluster(partitioner.MultivariatePartitioner):
|
||||
return ret
|
||||
|
||||
if self.kdtree is not None:
|
||||
fsets = self.search(data, **kwargs)
|
||||
fsets = self.search(data, type='name')
|
||||
else:
|
||||
fsets = self.incremental_search(data, **kwargs)
|
||||
|
||||
if len(fsets) == 0:
|
||||
fsets = self.incremental_search(data, **kwargs)
|
||||
raise Exception("{}".format(data))
|
||||
fsets = self.incremental_search(data, type='name')
|
||||
|
||||
mode = kwargs.get('mode', 'sets')
|
||||
if mode == 'sets':
|
||||
|
@ -188,7 +188,7 @@ vavg = variable.Variable("Radiation", data_label="glo_avg", alias='rad',
|
||||
|
||||
from pyFTS.models.multivariate import mvfts, wmvfts, cmvfts, grid
|
||||
|
||||
fs = grid.IncrementalGridCluster(explanatory_variables=[vmonth, vhour, vavg], target_variable=vavg)
|
||||
fs = grid.GridCluster(explanatory_variables=[vmonth, vhour, vavg], target_variable=vavg)
|
||||
|
||||
|
||||
model = cmvfts.ClusteredMVFTS(explanatory_variables=[vmonth, vhour, vavg], target_variable=vavg,
|
||||
@ -196,4 +196,4 @@ model = cmvfts.ClusteredMVFTS(explanatory_variables=[vmonth, vhour, vavg], targe
|
||||
|
||||
model.fit(train)
|
||||
|
||||
print(len(model))
|
||||
model.predict(test)
|
||||
|
Loading…
Reference in New Issue
Block a user