Skip to content

Commit f8cd366

Browse files
committed
Update : Change "assert_all_close"
1 parent 428f4f3 commit f8cd366

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

mapie/estimator/classifier.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ def predict_proba_calib(
415415
check_is_fitted(self, self.fit_attributes)
416416

417417
if self.cv == "prefit":
418-
y_pred_proba =\
419-
self.single_estimator_.predict_proba(X)
418+
y_pred_proba = self.single_estimator_.predict_proba(X)
420419
y_pred_proba = self._check_proba_normalized(y_pred_proba)
421420
else:
422421
X = cast(NDArray, X)

mapie/tests/test_classification.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
random_state = 42
3333

34-
3534
METHODS = ["lac", "aps", "raps"]
3635
WRONG_METHODS = ["scores", "cumulated", "test", "", 1, 2.5, (1, 2)]
3736
WRONG_INCLUDE_LABELS = ["randomised", "True", "False", "other", 1, 2.5, (1, 2)]
@@ -1999,9 +1998,9 @@ def test_predict_parameters_passing() -> None:
19991998

20001999
expected_conformity_scores = np.ones((X_train.shape[0], 1))
20012000
y_pred = mapie_model.predict(X_test, agg_scores="mean", **predict_params)
2002-
np.testing.assert_allclose(mapie_model.conformity_scores_,
2003-
expected_conformity_scores)
2004-
np.testing.assert_allclose(y_pred, 0)
2001+
np.testing.assert_equal(mapie_model.conformity_scores_,
2002+
expected_conformity_scores)
2003+
np.testing.assert_equal(y_pred, 0)
20052004

20062005

20072006
def test_with_no_predict_parameters_passing() -> None:
@@ -2069,9 +2068,9 @@ def test_predict_params_expected_behavior_unaffected_by_fit_params() -> None:
20692068

20702069
expected_conformity_scores = np.ones((X_train.shape[0], 1))
20712070

2072-
np.testing.assert_allclose(mapie_model.conformity_scores_,
2073-
expected_conformity_scores)
2074-
np.testing.assert_allclose(y_pred, 0)
2071+
np.testing.assert_equal(mapie_model.conformity_scores_,
2072+
expected_conformity_scores)
2073+
np.testing.assert_equal(y_pred, 0)
20752074

20762075

20772076
def test_using_one_predict_parameter_into_predict_but_not_in_fit() -> None:

0 commit comments

Comments
 (0)