File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import numpy as np
6
6
import pytest
7
- import scipy .sparse as sp
8
7
9
8
from sklearn ._config import config_context
10
9
from sklearn .datasets import make_multilabel_classification
66
65
assert_array_less ,
67
66
ignore_warnings ,
68
67
)
68
+ from sklearn .utils .fixes import COO_CONTAINERS
69
69
from sklearn .utils .multiclass import type_of_target
70
70
from sklearn .utils .validation import _num_samples , check_random_state
71
71
@@ -1033,7 +1033,8 @@ def test_multioutput_regression_invariance_to_dimension_shuffling(name):
1033
1033
1034
1034
1035
1035
@ignore_warnings
1036
- def test_multilabel_representation_invariance ():
1036
+ @pytest .mark .parametrize ("coo_container" , COO_CONTAINERS )
1037
+ def test_multilabel_representation_invariance (coo_container ):
1037
1038
# Generate some data
1038
1039
n_classes = 4
1039
1040
n_samples = 50
@@ -1057,8 +1058,8 @@ def test_multilabel_representation_invariance():
1057
1058
y1 = np .vstack ([y1 , [[0 ] * n_classes ]])
1058
1059
y2 = np .vstack ([y2 , [[0 ] * n_classes ]])
1059
1060
1060
- y1_sparse_indicator = sp . coo_matrix (y1 )
1061
- y2_sparse_indicator = sp . coo_matrix (y2 )
1061
+ y1_sparse_indicator = coo_container (y1 )
1062
+ y2_sparse_indicator = coo_container (y2 )
1062
1063
1063
1064
y1_list_array_indicator = list (y1 )
1064
1065
y2_list_array_indicator = list (y2 )
You can’t perform that action at this time.
0 commit comments