Skip to content

Commit

Permalink
Merge pull request #440 from scikit-learn-contrib/439-specifying-cond…
Browse files Browse the repository at this point in the history
…a-version

chore: update miniconda version to latest stable
  • Loading branch information
LacombeLouis authored May 13, 2024
2 parents 3813eae + c666194 commit 18cb1c5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
python-version: ${{ matrix.python-version }}
environment-file: environment.ci.yml
channels: defaults, conda-forge
miniconda-version: "latest"
- name: Install numpy
run: conda install numpy=${{ matrix.numpy-version }}
- name: Check linting
Expand Down
8 changes: 7 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
History
=======

0.8.3 (2024-**-**)
------------------

* Fix conda versionning.
* Reduce precision for test in `MapieCalibrator`.

0.8.3 (2024-03-01)
------------------

Expand All @@ -13,7 +19,7 @@ History
0.8.2 (2024-01-11)
------------------

* * Resolve issue still present in 0.8.1 by updating pandas.
* Resolve issue still present in 0.8.1 by updating pandas.

0.8.1 (2024-01-11)
------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
print(
"Coverage / prediction interval width mean for MapieTimeSeriesRegressor: "
"\nEnbPI without any partial_fit:"
f"{coverage_npfit_enbpi :.3f}, {width_npfit_enbpi:.3f}"
f"{coverage_npfit_enbpi:.3f}, {width_npfit_enbpi:.3f}"
)
print(
"Coverage / prediction interval width mean for MapieTimeSeriesRegressor: "
Expand Down
18 changes: 9 additions & 9 deletions mapie/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ class MapieCalibrator(BaseEstimator, ClassifierMixin):
>>> mapie = MapieCalibrator().fit(X_toy, y_toy, random_state=20)
>>> y_calib = mapie.predict_proba(X_toy)
>>> print(y_calib)
[[0.84900723 nan nan]
[0.75432411 nan nan]
[0.62285341 nan nan]
[ nan 0.33333333 nan]
[ nan 0.33333333 nan]
[ nan 0.33333333 nan]
[ nan nan 0.33333002]
[ nan nan 0.54326683]
[ nan nan 0.66666124]]
[[0.84...... nan nan]
[0.75...... nan nan]
[0.62...... nan nan]
[ nan 0.33...... nan]
[ nan 0.33...... nan]
[ nan 0.33...... nan]
[ nan nan 0.33......]
[ nan nan 0.54......]
[ nan nan 0.66......]]
"""

fit_attributes = [
Expand Down
8 changes: 6 additions & 2 deletions mapie/tests/test_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ def test_correct_results(cv: str) -> None:
pred_ = mapie_cal.predict_proba(X_test)
top_label_ece_ = top_label_ece(y_test, pred_)
np.testing.assert_array_almost_equal(
results[cv]["y_score"], pred_ # type:ignore
np.array(results[cv]["y_score"]),
np.array(pred_),
decimal=2
)
np.testing.assert_allclose( # type:ignore
results[cv]["top_label_ece"],
Expand Down Expand Up @@ -345,7 +347,9 @@ def test_correct_results_binary(cv: str) -> None:
top_label_ece_ = top_label_ece(y_binary, pred_)
ece = expected_calibration_error(y_binary, pred_)
np.testing.assert_array_almost_equal(
results_binary[cv]["y_score"], pred_ # type:ignore
np.array(results_binary[cv]["y_score"]),
np.array(pred_),
decimal=2
)
np.testing.assert_allclose( # type:ignore
results_binary[cv]["top_label_ece"],
Expand Down

0 comments on commit 18cb1c5

Please sign in to comment.