Skip to content

Commit 0d8b64b

Browse files
Fix some warnings when running tests (#745)
1 parent ad7470e commit 0d8b64b

File tree

4 files changed

+3
-11
lines changed

4 files changed

+3
-11
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ History
55
1.x.x (2025-xx-xx)
66
------------------
77

8+
* Fix warnings when running tests
89
* Fix incorrect URL in PrecisionRecallController docstring
910
* Delete redundant risk control notebooks
1011
* Add link to Thibault Cordier's repository on risk control

mapie/metrics/classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def classification_ssc(
208208
indexes,
209209
axis=0
210210
)
211-
)
211+
).item()
212212
return coverages
213213

214214

mapie/tests/test_control_risk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_recall_with_zero_sum_is_equal_nan() -> None:
8181
y_toy = np.zeros((4, 3))
8282
y_preds_proba = prng.rand(4, 3, 1)
8383
recall = compute_risk_recall(lambdas, y_preds_proba, y_toy)
84-
np.testing.assert_array_equal(recall, np.empty_like(recall))
84+
np.testing.assert_array_equal(recall, np.full_like(recall, np.nan))
8585

8686

8787
def test_precision_with_zero_sum_is_equal_ones() -> None:

mapie/utils.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -617,15 +617,6 @@ def _check_alpha_and_n_samples(
617617
If the number of samples of the score is too low,
618618
1/alpha (or 1/(1 - alpha)) must be lower than the number of samples.
619619
620-
Examples
621-
--------
622-
>>> import numpy as np
623-
>>> from mapie.utils import _check_alpha_and_n_samples
624-
>>> try:
625-
... _check_alpha_and_n_samples(np.array([1,2,3]), 0.5)
626-
... except Exception as exception:
627-
... print(exception)
628-
...
629620
Number of samples of the score is too low,
630621
1/confidence_level and 1/(1 - confidence_level) must be
631622
lower than the number of samples.

0 commit comments

Comments
 (0)