Update scikit-learn to 0.24.1 - #659
Merged
Merged
Conversation
- `GridSearchCV` now does not explicitly raise an error if there was an error in fitting the estimator. Rather, it simply returns `nan` as the score. This is not what we want in SKLL, so we set the `error_score` parameter to `raises` which will behave as expected.
…nto 653-update-sklearn-to-0-24-1
- This requires setting `_use_dense_features` since sklearn requires non-sparse features for this type of model.
Codecov Report
@@ Coverage Diff @@
## main #659 +/- ##
=======================================
Coverage 95.09% 95.09%
=======================================
Files 27 27
Lines 3101 3101
=======================================
Hits 2949 2949
Misses 152 152
Continue to review full report at Codecov.
|
aoifecahill
approved these changes
Feb 4, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #653.
It pretty much works out of the box except for two changes:
Setting the new keyword argument
error_scoreto "raises" in the GridSearchCV() call made in Learner.train() since we want to raise an exception if there was any problem with fitting the estimator. This change is necessary because the new scikit-learn default is to simply return a nan as the fit score in case of a problem which does not work for us.LinearRegressionmodels in scikit-learn now support a new keyword argumentpositivewhich can be set toTrueto use Non-negative Least Squares (NNLS) regression. This is probably something we want to enable in SKLL since it could be useful in RSMTool. This required the fix forLearner._check_input_formatting()does not work for dense featuresets #656 which has already been merged.Add a test for this new non-negative regression.
Other minor changes:
Since Python 3.6 is so long in the tooth, I have changed the Linux builds (on Travis) to use Python 3.7 and the Windows builds (on Azure) to use Python 3.8. I am using Python 3.9 locally.
Update both
requirements.txtandconda_requirements.txtto use the new version of scikit-learn.