Skip to content

Commit

Permalink
Update exhaustive_feature_selector.py (#1104)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Nov 11, 2024
1 parent 91eb9a7 commit 41a5453
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mlxtend/feature_selection/exhaustive_feature_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41a5453

Please sign in to comment.