TST Extend tests for scipy.sparse.*array in model_selection/tests/test_validation.py#27366
TST Extend tests for scipy.sparse.*array in model_selection/tests/test_validation.py#27366OmarManzoor merged 12 commits intoscikit-learn:mainfrom
scipy.sparse.*array in model_selection/tests/test_validation.py#27366Conversation
sklearn.utils.class_weight.compute_class_weight.
| sparse_sample_weight.shape[0], X.shape[0] | ||
| ) | ||
| if sparse_param is not None: | ||
| P_sparse = type(sparse_param)(P) |
There was a problem hiding this comment.
We don't really need P_sparse here. We only want to check the shape.
So you can remove this line and change P_sparse by P below.
|
Should the It appears when parameterizing with |
|
| # for StratifiedKFold(n_splits=3) | ||
| y2 = np.array([1, 1, 1, 2, 2, 2, 3, 3, 3, 3]) | ||
| P_sparse = coo_matrix(np.eye(5)) | ||
| P_sparse = COO_CONTAINERS[-1](np.eye(5)) |
There was a problem hiding this comment.
It is not what I meant. What I meant was to change the usage of P_sparse and use P in the Mock classifier since we are only interested about the shape of the data. The sparsity in the Mock does not matter so much.
I completely overlooked this. Have just changed Mock Classifier to use just |
OmarManzoor
left a comment
There was a problem hiding this comment.
LGTM. Thanks @brendanlu
…test_validation.py` (scikit-learn#27366)
Reference Issues/PRs
Towards #27090.
Any other comments?
Happy to make any changes.
EDIT: Construct
P_sparsedepending on the type of input it is being checked against in the dummy class...