Skip to content

Commit

Permalink
[MNT] 2.4.0 deprecations and change actions (#404)
Browse files Browse the repository at this point in the history
Carries out deprecations and change actions scheduled for 2.4.0.

* in `CyclicBoosting`, final removal of `bounds` parameter
* bump an action erroneously scheduled for 2.4.0 to 2.5.0 (in GLM)
  • Loading branch information
fkiraly authored Jun 23, 2024
1 parent 0abc014 commit 0b495ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
33 changes: 0 additions & 33 deletions skpro/regression/cyclic_boosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def __init__(
feature_properties=None,
alpha=0.2,
mode="multiplicative",
bound="deprecated",
lower=None,
upper=None,
maximal_iterations=10,
Expand All @@ -150,7 +149,6 @@ def __init__(
self.feature_properties = feature_properties
self.alpha = alpha
self.mode = mode
self.bound = bound
self.lower = lower
self.upper = upper
self.maximal_iterations = maximal_iterations
Expand All @@ -164,36 +162,6 @@ def __init__(
self.quantile_est = list()
self.qpd = None

# todo 2.4.0: remove bound parameter and this deprecation warning
if bound == "deprecated":
warnings.warn(
"In CyclicBoosting, the 'bound' parameter is deprecated, "
"and will be removed in skpro version 2.4.0. "
"To retain the current behavior, and silence this warning, "
"do not set the 'bound' parameter "
"and set 'lower' and 'upper' parameters instead, "
"as follows: for unbounded mode, previously bound='U', "
"set 'lower' and 'upper' to None; "
"for semi-bounded mode, previously bound='S', "
"set 'lower' to lower bound and 'upper' to None; "
"for bounded mode, previously bound='B', "
"set 'lower' to lower bound and 'upper' to upper bound.",
DeprecationWarning,
stacklevel=2,
)

# todo 2.4.0: remove this block
# translate bound to lower and upper
if lower is None and bound in ["S", "B"]:
self._lower = 0.0
else:
self._lower = None
if upper is None and bound == "B":
self._upper = 1.0
else:
self._upper = upper
# end block

# check parameters
if (not isinstance(feature_groups, list)) and feature_groups is not None:
raise ValueError("feature_groups needs to be list")
Expand Down Expand Up @@ -342,7 +310,6 @@ def _predict_proba(self, X):
yhat = est.predict(X.copy())
self.quantile_values.append(yhat)

# todo 2.4.0: replace self._lower and self._upper with self.lower and self.upper
# Johnson Quantile-Parameterized Distributions
params = {
"alpha": self.alpha,
Expand Down
2 changes: 1 addition & 1 deletion skpro/regression/linear/_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _str_to_sm_family(self, family, link):

return sm_fmly[family]()

# TODO (release 2.4.0)
# TODO (release 2.5.0)
# replace the existing definition of `__init__` with
# the below definition for `__init__`.
# def __init__(
Expand Down

0 comments on commit 0b495ea

Please sign in to comment.