From 315948362bf259b1c5ec29a28ec4b2a7d991b957 Mon Sep 17 00:00:00 2001 From: haghrah Date: Wed, 27 Nov 2024 14:49:32 +0330 Subject: [PATCH] Minor bug fixes ... --- pyit2fls/learning.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyit2fls/learning.py b/pyit2fls/learning.py index 24d0de9..332ad11 100644 --- a/pyit2fls/learning.py +++ b/pyit2fls/learning.py @@ -141,6 +141,10 @@ class T1Fuzzy_ML_Model: """ def __init__(self, P, N, M, mf, c=1.0): self.p = reshape(P[:-M], (M, N, 2, )) + for i in range(M): + for j in range(N): + self.p[i][j][1] = abs(self.p[i][j][1]) + self.q = P[-M:] self.N = N self.M = M @@ -248,8 +252,8 @@ def fit(self, X, y): else: raise ValueError(self.algorithm + " algorithm is not supported!") - self.model = T1Fuzzy_ML_Model(self.params, self.TSKN, self.TSKM, - [[self.mf, ] * self.TSKN, ] * self.TSKM) + self.model = T1Fuzzy_ML_Model(self.params, self.N, self.M, + [[self.mf, ] * self.N, ] * self.M) return self.error(self.params, X, y) def score(self, X):