Skip to content

Commit 7150ec9

Browse files
author
Vianney Taquet
committed
Fix one more time test with EPSILON
1 parent cfeaf00 commit 7150ec9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mapie/classification.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def _get_last_index_included(
406406
np.argmin(
407407
np.ma.masked_less(
408408
y_pred_proba_cumsum,
409-
threshold[np.newaxis, np.newaxis, :]
409+
threshold[np.newaxis, np.newaxis, :] - EPSILON
410410
),
411411
axis=1
412412
)
@@ -418,7 +418,10 @@ def _get_last_index_included(
418418
)
419419
y_pred_index_last = np.argmax(
420420
np.ma.masked_where(
421-
y_pred_proba_cumsum > max_threshold[:, np.newaxis, :],
421+
(
422+
y_pred_proba_cumsum >
423+
max_threshold[:, np.newaxis, :] - EPSILON
424+
),
422425
y_pred_proba_cumsum,
423426
), axis=1
424427
)
@@ -955,7 +958,7 @@ def predict(
955958
# above the last one
956959
if (cv == "prefit") or (agg_scores in ["mean"]):
957960
y_pred_included = (
958-
(y_pred_proba >= y_pred_proba_last - EPSILON)
961+
(y_pred_proba > y_pred_proba_last - EPSILON)
959962
)
960963
else:
961964
y_pred_included = (

0 commit comments

Comments
 (0)