From 0b2cacca9914b0413da10fc2fd26d5a71458d2f4 Mon Sep 17 00:00:00 2001 From: Dario Malchiodi Date: Mon, 2 Dec 2024 10:24:08 +0100 Subject: [PATCH] displayed wrong threshold/slope/intercept in fit warning --- mulearn/__init__.py | 2 +- mulearn/fuzzifier.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mulearn/__init__.py b/mulearn/__init__.py index 1d42504..114e7ec 100644 --- a/mulearn/__init__.py +++ b/mulearn/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.1.1' +__version__ = '1.1.2' import copy diff --git a/mulearn/fuzzifier.py b/mulearn/fuzzifier.py index b508783..abba336 100644 --- a/mulearn/fuzzifier.py +++ b/mulearn/fuzzifier.py @@ -187,7 +187,8 @@ def r2_to_mu(r, threshold): self.threshold_ = t_opt if self.threshold_ < 0: - logger.warning("Profile fit returned a negative parameter") + logger.warning("Profile fit returned a negative parameter " + f"({self.threshold_})") except RuntimeError: # interpolation could not take place, fall back to fixed profile self.profile = 'fixed' @@ -321,9 +322,11 @@ def r2_to_mu(R_2, r_2_1, r_2_0): raise ValueError("'profile' parameter should be equal to " "'fixed' or 'infer' (provided value: {self.profile})") if self.slope_ > 0: - logging.warning('Profile fitting returned a positive slope') + logging.warning('Profile fitting returned a positive slope ' + f'({self.slope_})') if self.intercept_ < 0: - logging.warning('Profile fitting returned a negative intercept') + logging.warning('Profile fitting returned a negative intercept ' + f'({self.intercept_})') return self @@ -465,9 +468,11 @@ def r2_to_mu(R_2, r_2_1): f"(provided value: {self.profile})") if self.slope_ > 0: - logging.warning('Profile fitting returned a positive slope') + logging.warning('Profile fitting returned a positive slope ' + f'({self.slope_})') if self.intercept_ < 0: - logging.warning('Profile fitting returned a negative intercept') + logging.warning('Profile fitting returned a negative intercept ' + f'({self.intercept_})') return self @@ -618,4 +623,4 @@ def get_membership(self, R_2): if r_2 <= self.r_2_1_+self.max_\ else 0 for r_2 in R_2]) - \ No newline at end of file +