-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
ENH support sparse data input for QuantileRegressor #21086
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
Conversation
@glemaitre |
Thanks @venkyyuvy It seems that the CIs are still not passing. Can you check what is the reason. Do not hesitate if it seems to be a tricky corner case. |
There is change in the coef value when alpha is 0 (between sparse and dense input).
|
@venkyyuvy Does this error persist with BTW, the whatsnew entry should go into 1.1 instead of 1.0. |
sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the following comments have been addressed.
Tests are failing in 3 envs alone. I'm not able to reproduce that in my local. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merge main
to see if the errors are still issued. Otherwise, I give a couple of comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another round. I still need to look at the tests.
test cases for csc alone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide which solver to allow for sparse input X
. The 4 solvers "highs-ds", "highs-ipm", "highs", "interior-point"
are possible.
Edit I, however, am in favor of starting with the highs* ones only.
I think, we should for sure add all highs solvers for sparse matrices as well as "interior-point" (in which case one needs to pass the extra option "sparse": True"
in linprog
). This then needs a test checking for a raised ValueError
in the case of sparse input and solvers that don't support sparse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next iteration. The docstring of the parameter solver
needs an update about which solvers support sparse input.
@pytest.mark.parametrize( | ||
"sparse_format", [sparse.csc_matrix, sparse.csr_matrix, sparse.coo_matrix] | ||
) | ||
@pytest.mark.parametrize("solver", ["highs"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pytest.mark.parametrize("solver", ["highs"]) | |
@pytest.mark.parametrize("solver", ["highs-ds", "highs-ipm", "highs", "interior-point"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for interior-point solver alone, the test cases are failing. can we allow only highs* solver as of now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But then we should raise a ValueError, if interior-point is used with sparse data and the docstring has to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And add it to test_compatible_solver_sparse
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error persist even if I set 'sparse': True
in solver options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 2 final nitpicks.
@venkyyuvy Thanks for the endurance to finish this. Still, we need one more reviewer approval.
@glemaitre @agramfort @rth @TomDLT might be interested in giving a 2nd review approval. |
Maybe also @avidale? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @lorentzenchr @glemaitre @ogrisel @avidale |
Thanks @venkyyuvy |
Reference Issues/PRs:
partially addresses #20132.
What does this implement/fix? Explain your changes.
Edit: This enables sparse
X
forQuantileRegressor
with the highs* solvers.Any other comments?