Skip to content

Commit 41a5453

Browse files
Haider010rasbtgedeck
authored
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 <[email protected]> --------- Co-authored-by: Sebastian Raschka <[email protected]> Co-authored-by: Peter Gedeck <[email protected]>
1 parent 91eb9a7 commit 41a5453

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mlxtend/feature_selection/exhaustive_feature_selector.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,11 @@ def ncr(n, r):
483483
return self
484484

485485
def finalize_fit(self):
486-
max_score = np.NINF
486+
if np.__version__ < "2.0":
487+
ninf = np.NINF
488+
else:
489+
ninf = -np.inf
490+
max_score = ninf
487491
for c in self.subsets_:
488492
if self.subsets_[c]["avg_score"] > max_score:
489493
best_subset = c

0 commit comments

Comments
 (0)