Skip to content

Commit d51f17b

Browse files
authored
TST Enhance ROC Curve Display Tests for Improved Clarity and Maintainability (scikit-learn#31266)
1 parent e29d727 commit d51f17b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

sklearn/metrics/_plot/tests/test_roc_curve_display.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from sklearn import clone
77
from sklearn.compose import make_column_transformer
8-
from sklearn.datasets import load_breast_cancer, load_iris
8+
from sklearn.datasets import load_breast_cancer, make_classification
99
from sklearn.exceptions import NotFittedError
1010
from sklearn.linear_model import LogisticRegression
1111
from sklearn.metrics import RocCurveDisplay, auc, roc_curve
@@ -16,20 +16,19 @@
1616

1717

1818
@pytest.fixture(scope="module")
19-
def data():
20-
X, y = load_iris(return_X_y=True)
21-
# Avoid introducing test dependencies by mistake.
22-
X.flags.writeable = False
23-
y.flags.writeable = False
19+
def data_binary():
20+
X, y = make_classification(
21+
n_samples=200,
22+
n_features=20,
23+
n_informative=5,
24+
n_redundant=2,
25+
flip_y=0.1,
26+
class_sep=0.8,
27+
random_state=42,
28+
)
2429
return X, y
2530

2631

27-
@pytest.fixture(scope="module")
28-
def data_binary(data):
29-
X, y = data
30-
return X[y < 2], y[y < 2]
31-
32-
3332
@pytest.mark.parametrize("response_method", ["predict_proba", "decision_function"])
3433
@pytest.mark.parametrize("with_sample_weight", [True, False])
3534
@pytest.mark.parametrize("drop_intermediate", [True, False])

0 commit comments

Comments
 (0)