Skip to content

Commit

Permalink
Bugfix: Wrong number of partitions been generated by GridPartitioner
Browse files Browse the repository at this point in the history
  • Loading branch information
petroniocandido authored Oct 24, 2022
1 parent a027c89 commit 6a6eb77
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyFTS/partitioners/Grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ def build(self, data):

kwargs = {'type': self.type, 'variable': self.variable}

dlen = self.max - self.min
partlen = dlen / self.partitions
#dlen = self.max - self.min
#partlen = dlen / self.partitions

count = 0
for c in np.arange(self.min, self.max, partlen):
centers, partlen = np.linspace(self.min, self.max, self.partitions, retstep=True)
for c in centers:
_name = self.get_name(count)
if self.membership_function == Membership.trimf:
sets[_name] = FuzzySet.FuzzySet(_name, Membership.trimf, [c - partlen, c, c + partlen],c,**kwargs)
Expand Down

0 comments on commit 6a6eb77

Please sign in to comment.