Fix compatibility with Pandas > 3.0#535
Conversation
Make DummyEstimator a valid scikit-learn regressor so cross-validation no longer fails on scikit-learn>=1.8. Also pass an estimator instance to check_scoring and add a regression test for the BaseGridder.score path.
|
The new CI failures in this PR turned out to be separate from the I ran a small Python 3.12 version matrix and the failures reproduced whenever To keep Once |
|
The follow-up pandas compatibility work is now in this PR directly. Since the temporary Current state as of 2026-03-12:
At this point, |
|
Hi @Gabriel-Goes thanks for submitting this! I'm going through the changes to see if I understand all that happened since this is now a sklearn and pandas compatibility fix. I'll get back to you as soon as possible. |
leouieda
left a comment
There was a problem hiding this comment.
Hi @Gabriel-Goes thank again for doing this! See some comments below. If the RegressorMixin is not absolutely necessary, I'd remove those and then this PR is a fix to the Pandas issue only.
leouieda
left a comment
There was a problem hiding this comment.
Great! Merging this in.
@Gabriel-Goes please open another PR adding yourself to AUTHORS.md if you'd like to be included in the list of authors for the Zenodo archive of Verde. Thanks again for your help with this!
|
Also, come by my office at IAG and I can give you some Fatiando stickers 🙂 |
Update 2026-03-16: Reworked to fix only the Pandas 3 compatibility issues.
Fixes #536
This updates
DummyEstimatorso Verde scoring works again withscikit-learn>=1.8, which now checks estimator tags during scoring.Compared to #531, this keeps the same root fix but also:
check_scoringDummyEstimatoras a regressor viaRegressorMixin, BaseEstimatorBaseGridder.scorepath shown in the issue tracebackTemporary dependency note:
BlockMeancompatibility issue withpandas 3.0, now tracked in BlockMean fails with pandas 3.0 in latest CI matrix #536pandas 3.0.1, notnumpy 2.4.2pandas<3pandas 3compatibility fix will happen in a follow-up linked to BlockMean fails with pandas 3.0 in latest CI matrix #536Validation run locally:
pytest verde/tests/test_model_selection.py -q -k "not client".score(...)tests intest_vector.pyandtest_chain.pyvd.Spline()+vd.cross_val_score(...)repro underscikit-learn 1.8.0pandas 3.0.1I did not use the legacy
clienttest as acceptance criteria because it hangs in the temporary validation environment and appears unrelated to this bugfix.