TST Extend tests for scipy.sparse.*array in sklearn/impute/tests/test_impute.py#27208
Merged
glemaitre merged 3 commits intoscikit-learn:mainfrom Sep 13, 2023
Merged
TST Extend tests for scipy.sparse.*array in sklearn/impute/tests/test_impute.py#27208glemaitre merged 3 commits intoscikit-learn:mainfrom
scipy.sparse.*array in sklearn/impute/tests/test_impute.py#27208glemaitre merged 3 commits intoscikit-learn:mainfrom
Conversation
OmarManzoor
approved these changes
Aug 31, 2023
sklearn/impute/tests/test_impute.py
Outdated
| def test_missing_indicator_new( | ||
| missing_values, arr_type, dtype, param_features, n_features, features_indices | ||
| ): | ||
| if missing_values == 0 and arr_type is not np.array: |
Contributor
There was a problem hiding this comment.
Even though this if condition does seem a bit awkward, I think it looks okay. Let's see if another maintainer has a better idea.
glemaitre
approved these changes
Sep 13, 2023
Member
glemaitre
left a comment
There was a problem hiding this comment.
LGTM. I prefer to filter while generating the cases in the parametrization instead of filtering in the test.
Contributor
Author
|
@glemaitre |
Member
Since it was used in the other parametrization, we can put it here. This should be fine (at least it was passing locally). Usually whatever is not CSR, CSC will be converted to one of those two. |
REDVM
pushed a commit
to REDVM/scikit-learn
that referenced
this pull request
Nov 16, 2023
…est_impute.py` (scikit-learn#27208) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Towards #27090.
What does this implement/fix? Explain your changes.
Any other comments?
Function(not test)
_check_statisticsused csc_matrix, and was used in 3 tests, so i parameterised them.Tests
test_missing_indicator_newandtest_missing_indicator_sparse_paramwere little tricky to parameterise, if you have any other smooth solution, I will be glad to hear it.