Skip to content

Conversation

@jolars
Copy link
Contributor

@jolars jolars commented Apr 10, 2025

Context of the PR

I think the failing test for SLOPE observed in #282 was due to the Slope estimator
normalizing data by default.

Contributions of the PR

I've turned off normalization in the test now.
(I realize that it might not be completely kosher to normalize in these sklearn
estimators so I'll change the default for the sortedl1 package as well, but
we might as well make it explicit here).

The test is working at least locally for me now.

Checks before merging PR

  • added documentation for any new feature
  • added unit tests
  • edited the what's new (if applicable)

clf = SlopeEst(
alpha=0.01,
fit_intercept=False,
scaling = "none",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake is going to complain about extra spaces around equal here and line below

@mathurinm
Copy link
Collaborator

mathurinm commented Apr 10, 2025

@jolars There are 6 failing not due to Slope, but the last one is because the shape mismatch, you need to squeeze the coefs of libslope:

(shapes (10,), (10, 1) mismatch)
 ACTUAL: array([ 1.267978,  0.254253, -0.641967,  0.406315, -0.147703,  0.451324,
       -0.025444, -0.292776,  0.158982, -0.172514])
 DESIRED: array([[ 1.267984],
       [ 0.254267],
       [-0.642008],...

also probably the numerical tolerances are too low

@jolars jolars force-pushed the fix-slope-test-error branch from 5f6b580 to 634c597 Compare April 10, 2025 17:16
@jolars
Copy link
Contributor Author

jolars commented Apr 10, 2025

@jolars There are 6 failing not due to Slope, but the last one is because the shape mismatch, you need to squeeze the coefs of libslope:

(shapes (10,), (10, 1) mismatch)
 ACTUAL: array([ 1.267978,  0.254253, -0.641967,  0.406315, -0.147703,  0.451324,
       -0.025444, -0.292776,  0.158982, -0.172514])
 DESIRED: array([[ 1.267984],
       [ 0.254267],
       [-0.642008],...

also probably the numerical tolerances are too low

Sorry! I manage to miss this due to not having the package installed 😬

I realized that I am also using arguments that are just in the development version. I suppose the reason it's not failing here is that you're installing straight from the github repo and not pypi. Let me push a new version to pypi and then I'll tidy this up.

@jolars
Copy link
Contributor Author

jolars commented Apr 13, 2025

I believe the SLOPE tests are fixed now. Let me know if this is fine and I'll squash the fixup commits.

@mathurinm
Copy link
Collaborator

@jolars thanks for the PR !

No need to squash on your side, we perform "squash and merge" directly on the UI

@mathurinm mathurinm merged commit 1799819 into scikit-learn-contrib:main Apr 14, 2025
3 of 4 checks passed
floriankozikowski pushed a commit to PascalCarrivain/skglm that referenced this pull request Apr 22, 2025
@jolars jolars deleted the fix-slope-test-error branch May 30, 2025 18:28
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.

2 participants