Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ History
* Fix issue 547 to fix wrong warning
* Fix issue 480 (correct display of mathematical equations in generated notebooks)
* Refactor MapieRegressor, EnsembleRegressor, and MapieQuantileRegressor, to prepare for the release of v1.0.0
* Remove optimize_beta usage warning when using for methods other than EnbPI

0.9.1 (2024-09-13)
------------------
Expand Down
8 changes: 0 additions & 8 deletions mapie/regression/regression.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import warnings
from typing import Any, Iterable, Optional, Tuple, Union, cast

import numpy as np
Expand Down Expand Up @@ -694,13 +693,6 @@ def predict(
return np.array(y_pred)

else:
if optimize_beta and self.method != 'enbpi':
warnings.warn(
"WARNING: Beta optimisation should only be used for "
"method='enbpi'.",
UserWarning
)

# Check alpha and the number of effective calibration samples
alpha_np = cast(NDArray, alpha)
if not allow_infinite_bounds:
Expand Down
13 changes: 0 additions & 13 deletions mapie/tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,19 +864,6 @@ def test_return_multi_pred(ensemble: bool) -> None:
assert len(output) == 3


def test_beta_optimize_user_warning() -> None:
"""
Test that a UserWarning is displayed when optimize_beta is used.
"""
mapie_reg = MapieRegressor(
conformity_score=AbsoluteConformityScore(sym=False)
).fit(X, y)
with pytest.warns(
UserWarning, match=r"Beta optimisation should only be used for*",
):
mapie_reg.predict(X, alpha=0.05, optimize_beta=True)


def test_fit_parameters_passing() -> None:
"""
Test passing fit parameters, here early stopping at iteration 3.
Expand Down
Loading