From 41a5453b221f716dde6aa2489ed6ac31951bcb8b Mon Sep 17 00:00:00 2001 From: Haider Karar <96874672+Haider010@users.noreply.github.com> Date: Tue, 12 Nov 2024 02:45:50 +0500 Subject: [PATCH] Update exhaustive_feature_selector.py (#1104) * Update exhaustive_feature_selector.py AttributeError: `np.NINF` was removed in the NumPy 2.0 release. Use `-np.inf` instead. Fixed this Error. * Update mlxtend/feature_selection/exhaustive_feature_selector.py Co-authored-by: Peter Gedeck --------- Co-authored-by: Sebastian Raschka Co-authored-by: Peter Gedeck --- mlxtend/feature_selection/exhaustive_feature_selector.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mlxtend/feature_selection/exhaustive_feature_selector.py b/mlxtend/feature_selection/exhaustive_feature_selector.py index bbbd1f846..4b297ea1e 100644 --- a/mlxtend/feature_selection/exhaustive_feature_selector.py +++ b/mlxtend/feature_selection/exhaustive_feature_selector.py @@ -483,7 +483,11 @@ def ncr(n, r): return self def finalize_fit(self): - max_score = np.NINF + if np.__version__ < "2.0": + ninf = np.NINF + else: + ninf = -np.inf + max_score = ninf for c in self.subsets_: if self.subsets_[c]["avg_score"] > max_score: best_subset = c