8000 fix: upgrade scaffolding and support sklearn v1.6 by sinopeus · Pull Request #34 · superlinear-ai/conformal-tights · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: upgrade s 8000 caffolding and support sklearn v1.6 #34

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

Merged
merged 22 commits into from
Mar 8, 2025
Merged

Conversation

sinopeus
Copy link
Contributor
@sinopeus sinopeus commented Feb 17, 2025

Changes:

  1. Upgrade scaffolding to Substrate, with a new test matrix.
  2. Increase minimum versions of dependencies to support Python 3.12.
  3. Add a scipy<1.15 constraint because of BUG: optimize.linprog: 40x slower in v1.15 compared to v1.14 scipy/scipy#22655.
  4. Add support for sklearn v1.6.
  5. Add support for darts v0.30+.
  6. Replace α = np.sqrt(eps) with α = eps**0.25 to address a floating point issue discovered by check_model.

@sinopeus sinopeus self-assigned this Feb 17, 2025
@sinopeus sinopeus force-pushed the rescaffold branch 2 times, most recently from c00c15b to 155d542 Compare February 17, 2025 14:41
@MattiaMolon
Copy link
MattiaMolon commented Feb 27, 2025

Sklearn introduced a new data validation method in 1.6.0, which is validate_data.
This new method should replace the old validation methods check_X_y and check_array.

This change solves the old issue but generates a new one that seems more related to how the package works rather than the scaffolding update:

FAILED tests/test_coherent_linear_quantile_regressor.py::test_sklearn_check_estimator - AssertionError: 
Not equal to tolerance rtol=1e-07, atol=1e-09
Comparing the output of CoherentLinearQuantileRegressor.predict revealed that fitting with `sample_weight` is not equivalent to fitting with removed or repeated data points.
Mismatched elements: 6 / 15 (40%)
Max absolute difference: 0.81989351
Max relative difference: 3.9030648e+14
 x: array([-7.771561e-16,  1.000000e+00,  2.000000e+00,  4.703027e-01,
        1.344856e+00,  1.000000e+00,  2.000000e+00,  2.000000e+00,
        1.240994e+00,  2.000000e+00,  9.156769e-01,  8.198935e-01,
        7.253211e-01,  1.000000e+00,  1.000000e+00])
 y: array([-1.195963e-15,  1.000000e+00,  2.000000e+00,  7.697990e-01,
        1.000000e+00,  1.000000e+00,  2.000000e+00,  2.000000e+00,
        1.069734e+00,  2.000000e+00,  9.431679e-01, -2.100640e-15,
        1.000000e+00,  1.000000e+00,  1.000000e+00])

@sinopeus
Copy link
Contributor Author

Thanks for investigating @MattiaMolon ! Makes sense, but then we need to make sure that we have a fallback for users on sklearn < 1.6, as that is allowed according to our dependency spec. In any case I have a suspicion that fixing whatever the issue is for validate_data will fix it for check_X_y too. To be continued 🙂

r-dh and others added 5 commits March 7, 2025 14:56
- Fix sample weight handling in CoherentLinearQuantileRegressor to match sklearn's expectations
- Update parameter names from force_all_finite to ensure_all_finite for sklearn 1.6.0
- Add backward compatibility for both parameter names to support sklearn < 1.6.0
- Improve error handling for sample weights validation
@lsorber lsorber changed the title chore: rescaffold with Substrate fix: upgrade scaffolding and support sklearn v1.6+ Mar 8, 2025
@lsorber lsorber changed the title fix: upgrade scaffolding and support sklearn v1.6+ fix: upgrade scaffolding and support sklearn v1.6 Mar 8, 2025
@lsorber lsorber merged commit dfee6ba into main Mar 8, 2025
4 checks passed
@lsorber lsorber deleted the rescaffold branch March 8, 2025 23:32
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.

4 participants
0