remove np.array in cMeans

This commit is contained in:
Антон Скалкин 2024-08-06 15:18:31 +04:00
parent 47e78bc066
commit c24ebe6b81

View File

@ -87,11 +87,11 @@ class CMeansPartitioner(partitioner.Partitioner):
kwargs = {'type': self.type, 'variable': self.variable}
centroides = c_means(self.partitions, data, 1)
centroides = [v[0] for v in centroides]
centroides.append(self.max)
centroides.append(self.min)
centroides = list(set(centroides))
centroides.sort()
for c in np.arange(1, len(centroides) - 1):
for c in range(1, len(centroides) - 1):
_name = self.get_name(c)
sets[_name] = FuzzySet.FuzzySet(_name, Membership.trimf,
[round(centroides[c - 1], 3), round(centroides[c], 3), round(centroides[c + 1], 3)],