MNT Sklearn1.6 compatibility#447
Conversation
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
|
Issue in |
This comment was marked as outdated.
This comment was marked as outdated.
|
Can you get the output with |
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
The issue is about versioning again, taking care of separating the SGD stuff by sklearn version would most likely solve these last errors. I will look into it today, seems a bit more complex in this case then the rest, at least at first glance. I will ping with questions. |
adrinjalali
left a comment
There was a problem hiding this comment.
This would pass tests once scikit-learn/scikit-learn#30356 is merged in sklearn
| X, y = get_input(estimator) | ||
| tags = _safe_tags(estimator) | ||
| if tags.get("requires_fit", True): | ||
| if get_tags(estimator).requires_fit: |
There was a problem hiding this comment.
scikit-learn now uses dataclasses for tags, which are emulated here for old sklearn as well
| Huber, | ||
| Log, | ||
| LossFunction, |
There was a problem hiding this comment.
scikit-learn has moved to a more central place for loss functions / classes, and therefore the ones which are used between estimators are removed from the sgd specific file.
| from sklearn._loss._loss import ( | ||
| CyAbsoluteError, | ||
| CyExponentialLoss, | ||
| CyHalfBinomialLoss, | ||
| CyHalfGammaLoss, | ||
| CyHalfMultinomialLoss, | ||
| CyHalfPoissonLoss, | ||
| CyHalfSquaredError, | ||
| CyHalfTweedieLoss, | ||
| CyHalfTweedieLossIdentity, | ||
| CyHuberLoss, | ||
| CyPinballLoss, | ||
| ) | ||
|
|
There was a problem hiding this comment.
these are the new loss classes
|
|
||
|
|
||
| def _assert_generic_objects_equal(val1, val2): | ||
| def _assert_generic_objects_equal(val1, val2, path=""): |
There was a problem hiding this comment.
I've added the path argument to give the devs a better verbose idea of where things fail, to debug things easier
|
|
||
| # Default settings for X | ||
| N_SAMPLES = 50 | ||
| N_SAMPLES = 100 |
There was a problem hiding this comment.
an SGD estimator was ill defined with 50 samples, increasing to 100
|
@adrinjalali any legwork left that you'd like to or can share to make this faster or it is good to go as it is when the changes are merged in sklearn? |
|
@TamaraAtanasoska what's left is to take all estimators generated by |
do you mean in Edit: I see this not about Should I take it on or you are already working on it? |
No I'm not working on that, you can take it on :) |
|
BTW, we're working with @glemaitre on this: https://github.com/glemaitre/sklearn-compat |
that is a cool effort! This can get stressful for a lot of folks otherwise |
|
@adrinjalali there is a |
|
Yes, that's exactly the error fixed with the now merged PR. The CI here should be green tomorrow once the nightly build is uploaded / updated. |
|
@adrinjalali refactor in c3da1b9 with the new changes regarding scikit-learn/scikit-learn#30372 although I guess that will be merged soon. If it gets merged before we merge I'd like to change the code slightly as I had it before as it was nicer :) |
adrinjalali
left a comment
There was a problem hiding this comment.
There's a whole bunch of fixes here. I think I rather merge this and do other fixes in separate PRs.
Also, it turns out we were NOT testing against old sklearn versions, which is fixed now here, but it makes CI fail on those old ones, but at least they're tested. Also, the nightly build should be fixed (at least I tested locally with a latest version).
Reference Issues/PRs
Fixes #443. Not fully working yet.
What does this implement/fix? Explain your changes.
A few of the compatibility errors, including the one explained in #443 are now fixed. There are some external failures(errors happening outside of
skops) that I am not sure how to fix. @adrinjalali any tips? Below are the remaining failures:Any other comments?
First PR to the project, the fixes might be off.
I understood #443 as I can remove all
SGDstuff from the_sklearn.pyfile when working withsklearn 1.6+, tests pass like that, I am just not sure if the change is supposed to be so severe?