-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
TST Extend tests for scipy.sparse.*array
in test_polynomial.py
#27166
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
TST Extend tests for scipy.sparse.*array
in test_polynomial.py
#27166
Conversation
It's important to look at the full traceback in the CI report to understand what causes the exception raised at the bottom of the traceback. Here if you walk up the traceback, you will see that the code in scikit-learn causing this error is: ../1/s/sklearn/preprocessing/_polynomial.py:498: in transform
out_col = X[:, col_idx].multiply(out_col) and the message of the exception is:
which suggest a potential fix to make the code in scikit-learn compatible with the new sparse arrays: out_col = X[:, [col_idx]].multiply(out_col) |
By the way that means that this PR will not just be about updating the tests but actually about fixing something in scikit-learn to add compatibility to the new scipy sparse arrays. Therefore, this PR will need an entry in the changelog ( |
scipy.sparse.*array
in test_polynomial.py
…github.com/work-mohit/scikit-learn into fix/preprocessing/tests/test_polynomial.py
@ogrisel Have a look on this PR. Let me know if any updates required. Double check the change log file. Thanks ! |
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 for the fix @work-mohit!
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 as well. Merging if the CIs turns green.
…cikit-learn#27166) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Towards #27090
What does this implement/fix? Explain your changes.
Extended the test cases for the test_polynomial.py file. All tests run smoothly except two:
FAILED sklearn/preprocessing/tests/test_polynomial.py::test_polynomial_features_csc_X[csc_array-4-False-False-float64] - NotImplementedError: We have not yet implemented 1D sparse slices; please index using explicit indices, e.g.
x[:, [0]]
FAILED sklearn/preprocessing/tests/test_polynomial.py::test_polynomial_features_csc_X[csc_array-4-False-True-float64] - NotImplementedError: We have not yet implemented 1D sparse slices; please index using explicit indices, e.g.
x[:, [0]]
Any other comments?
I've already tried
.A
to.toarray()
for csr_arrays but got nothing, the same errors keep coming. Maybe there is another source of error, unable to find it. Feel free to drop your review.