Skip to content

Commit

Permalink
add stacklevel = 1 to warnings.warn in ElasticNetRegression
Browse files Browse the repository at this point in the history
  • Loading branch information
robmeth committed Apr 21, 2023
1 parent 34f4562 commit 1cd2d42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/safeds/ml/classical/regression/_elastic_net_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def __init__(self, lasso_ratio: float = .5) -> None:
raise ValueError("lasso_ratio must be between 0 and 1.")
elif lasso_ratio == 0:
warnings.warn("ElasticNetRegression with lasso_ratio = 0 is essentially RidgeRegression."
" Use RidgeRegression instead for better numerical stability.")
" Use RidgeRegression instead for better numerical stability.", stacklevel=1)
elif lasso_ratio == 1:
warnings.warn("ElasticNetRegression with lasso_ratio = 0 is essentially LassoRegression."
" Use LassoRegression instead for better numerical stability.")
" Use LassoRegression instead for better numerical stability.", stacklevel=1)
self.lasso_ratio = lasso_ratio
self._wrapped_regressor: sk_ElasticNet | None = None
self._feature_names: list[str] | None = None
Expand Down

0 comments on commit 1cd2d42

Please sign in to comment.