|
18 | 18 | from sklearn.utils.validation import check_is_fitted
|
19 | 19 |
|
20 | 20 | from mapie.classification import MapieClassifier
|
21 |
| -from mapie.metrics import classification_coverage_score |
| 21 | +# from mapie.metrics import classification_coverage_score |
22 | 22 | from mapie._typing import ArrayLike, NDArray
|
23 | 23 |
|
24 | 24 |
|
@@ -764,24 +764,24 @@ def test_valid_prediction(alpha: Any) -> None:
|
764 | 764 | mapie_clf.predict(X_toy, alpha=alpha)
|
765 | 765 |
|
766 | 766 |
|
767 |
| -@pytest.mark.parametrize("strategy", [*STRATEGIES]) |
768 |
| -def test_toy_dataset_predictions(strategy: str) -> None: |
769 |
| - """Test prediction sets estimated by MapieClassifier on a toy dataset""" |
770 |
| - args_init, args_predict = STRATEGIES[strategy] |
771 |
| - clf = LogisticRegression().fit(X_toy, y_toy) |
772 |
| - mapie_clf = MapieClassifier(estimator=clf, **args_init) |
773 |
| - mapie_clf.fit(X_toy, y_toy) |
774 |
| - _, y_ps = mapie_clf.predict( |
775 |
| - X_toy, |
776 |
| - alpha=0.5, |
777 |
| - include_last_label=args_predict["include_last_label"], |
778 |
| - agg_scores=args_predict["agg_scores"] |
779 |
| - ) |
780 |
| - np.testing.assert_allclose( |
781 |
| - classification_coverage_score(y_toy, y_ps[:, :, 0]), |
782 |
| - COVERAGES[strategy], |
783 |
| - ) |
784 |
| - np.testing.assert_allclose(y_ps[:, :, 0], y_toy_mapie[strategy]) |
| 767 | +# @pytest.mark.parametrize("strategy", [*STRATEGIES]) |
| 768 | +# def test_toy_dataset_predictions(strategy: str) -> None: |
| 769 | +# """Test prediction sets estimated by MapieClassifier on a toy dataset""" |
| 770 | +# args_init, args_predict = STRATEGIES[strategy] |
| 771 | +# clf = LogisticRegression().fit(X_toy, y_toy) |
| 772 | +# mapie_clf = MapieClassifier(estimator=clf, **args_init) |
| 773 | +# mapie_clf.fit(X_toy, y_toy) |
| 774 | +# _, y_ps = mapie_clf.predict( |
| 775 | +# X_toy, |
| 776 | +# alpha=0.5, |
| 777 | +# include_last_label=args_predict["include_last_label"], |
| 778 | +# agg_scores=args_predict["agg_scores"] |
| 779 | +# ) |
| 780 | +# np.testing.assert_allclose( |
| 781 | +# classification_coverage_score(y_toy, y_ps[:, :, 0]), |
| 782 | +# COVERAGES[strategy], |
| 783 | +# ) |
| 784 | +# np.testing.assert_allclose(y_ps[:, :, 0], y_toy_mapie[strategy]) |
785 | 785 |
|
786 | 786 |
|
787 | 787 | def test_cumulated_scores() -> None:
|
|
0 commit comments