Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update exhaustive_feature_selector.py #1104

Merged
merged 4 commits into from
Nov 11, 2024
Merged

Update exhaustive_feature_selector.py #1104

merged 4 commits into from
Nov 11, 2024

Conversation

Haider010
Copy link
Contributor

AttributeError: np.NINF was removed in the NumPy 2.0 release. Use -np.inf instead. Fixed this Error.

Code of Conduct

Description

Related issues or pull requests

Pull Request Checklist

  • Added a note about the modification or contribution to the ./docs/sources/CHANGELOG.md file (if applicable)
  • Added appropriate unit test functions in the ./mlxtend/*/tests directories (if applicable)
  • Modify documentation in the corresponding Jupyter Notebook under mlxtend/docs/sources/ (if applicable)
  • Ran PYTHONPATH='.' pytest ./mlxtend -sv and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., PYTHONPATH='.' pytest ./mlxtend/classifier/tests/test_stacking_cv_classifier.py -sv)
  • Checked for style issues by running flake8 ./mlxtend

AttributeError: `np.NINF` was removed in the NumPy 2.0 release. Use `-np.inf` instead.
Fixed this Error.
@d-kleine
Copy link
Contributor

d-kleine commented Nov 5, 2024

Has been fixed with #1107 already, this issue can be closed

@gedeck
Copy link
Contributor

gedeck commented Nov 9, 2024

@d-kleine This fixes another occurrence of np.NINF in ExhaustiveFeatureSelector

However, not sure if this should be fixed in the same way as was done in #1107.

@d-kleine
Copy link
Contributor

@gedeck Thanks for pointing that out - yeah, you are right. I overlooked that there are two different feature selector implementations (exhaustive vs. sequential). About how this issue can be fixed, I would like to leave the final decision to @rasbt.

@rasbt
Copy link
Owner

rasbt commented Nov 10, 2024

Thanks for the PR, and I might have missed that previously, sorry!

The fix looks good, but I think it might break in earlier NumPy versions then (not everyone has transitioned to 2.0 yet I assume). The fix in #1107 by @d-kleine was actually ideal. If we could apply it here too, that'd be great.

@d-kleine
Copy link
Contributor

@Haider010 or @rasbt As I cannot contribute to this PR, please feel free to take my changes from #1107 for fixing this issue 🙂

@rasbt rasbt merged commit 41a5453 into rasbt:master Nov 11, 2024
2 checks passed
@d-kleine
Copy link
Contributor

Could you please release a new package version for pip users?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants