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

Set cv_score to -np.inf if OLS fit fails #640

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

1313e
Copy link

@1313e 1313e commented Dec 9, 2019

Description

This PR will automatically set the cross-validation score of an ordinary least-squares fit to -np.inf whenever the fit fails during sequential feature selection.
This ensures that whenever a least-squares fit fails, it does not fail the entire regression process, but simply goes to the next one (after all, if a fit fails, it simply means that that fit is terrible and should never be used, not that no fit ever will work).

Also, I made the modification in master, simply because it is a one-liner and I will be deleting the fork anyways afterward.
I can add the change to the CHANGELOG is required of course.

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

@coveralls
Copy link

coveralls commented Dec 9, 2019

Coverage Status

Coverage decreased (-0.01%) to 92.349% when pulling 9a6136f on 1313e:master into aa47008 on rasbt:master.

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.

None yet

2 participants