Upgrade scikit-learn to v1.0.1 - #702
Merged
Merged
Conversation
- Use 3.8 for Linux - Use 3.9 for Windows
- scikit-learn is dropping support for `np.matrix` which is what we get from `todense()`, so we need to use `toarray()` instead.
- The old default `squared_loss` has been deprecated and renamed to `squared_error`.
- Scikit-learn v1.0 will be deprecating the `normalize` attribute for linear models - This attribute is set to `False` by default in most scikit-learn linear models anyway and so no warnings are surfaced in SKLL. - However, for `Lars`, the default value of `normalize` is still set to `True` and so we need to force it to False to avoid deprecation warnings. - This code will actually lead to an execption in the `_create_estimator()` method when the `normalize` attribute doesn't exist, so that will be the perfect reminder to excise this if block entirely when the time comes.
Codecov Report
@@ Coverage Diff @@
## main #702 +/- ##
==========================================
+ Coverage 96.85% 96.89% +0.03%
==========================================
Files 63 63
Lines 9098 9197 +99
==========================================
+ Hits 8812 8911 +99
Misses 286 286
Continue to review full report at Codecov.
|
Contributor
|
Should the |
Collaborator
Author
Good catch! I will modify it to be the same as the requirements files. |
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 #699.
This change is pretty straightforward but it’s definitely backwards incompatible which we will reflect in the release version when we put together the release.
The change specifically motivated by the upgrade are:
requirements.txtandconda_requirements.txtto point to the latest scikit-learn (v1.0.1) and allow up to v1.0.2.squared_erroras the default value of thelossparameter forRANSACRegressor.toarray()for converting sparse numpy arrays to dense instead oftodense()since the latter returns annp.matrixinstead of annp.ndarray. Scikit-learn is planning to drop support fornp.matrixinputs and is already displayingFutureWarnings.normalizeattribute for linear modelsFalseby default in most scikit-learn linear models anyway and so no warnings are surfaced in SKLL.Lars, the default value ofnormalizeis still set toTrueand so we need to force it to False to avoidFutureWarninginstances.ifstatement added will actually lead to an execption in the_create_estimator()method when thenormalizeattribute doesn't exist, so that will be the perfect reminder to excise it entirely when the time comes.Other changes include: