Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/264-hyperparameter-optimization'…
Browse files Browse the repository at this point in the history
… into 264-hyperparameter-optimization
  • Loading branch information
sibre28 committed Aug 29, 2024
2 parents 6c72375 + 5c80f7f commit 7346dfc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/safeds/ml/classical/regression/test_linear_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_should_raise_if_alpha_out_of_bounds_ridge(self, alpha: float | Choice[f

def test_should_assert_alpha_is_set_correctly(self) -> None:
alpha = 0.69
assert LinearRegressor.Penalty.ridge(alpha=alpha).alpha == alpha # type: ignore[attr-defined]
assert LinearRegressor.Penalty.ridge(alpha=alpha).alpha == alpha # type: ignore[attr-defined]

class TestLasso:
def test_str(self) -> None:
Expand All @@ -131,7 +131,7 @@ def test_should_raise_if_alpha_out_of_bounds_lasso(self, alpha: float | Choice[f

def test_should_assert_alpha_is_set_correctly(self) -> None:
alpha = 0.69
assert LinearRegressor.Penalty.lasso(alpha=alpha).alpha == alpha # type: ignore[attr-defined]
assert LinearRegressor.Penalty.lasso(alpha=alpha).alpha == alpha # type: ignore[attr-defined]

class TestElasticNet:
def test_str(self) -> None:
Expand All @@ -156,6 +156,5 @@ def test_should_assert_alpha_is_set_correctly(self) -> None:
alpha = 0.69
lasso_ratio = 0.96
elastic_pen = LinearRegressor.Penalty.elastic_net(alpha=alpha, lasso_ratio=lasso_ratio)
assert elastic_pen.alpha == alpha # type: ignore[attr-defined]
assert elastic_pen.lasso_ratio == lasso_ratio # type: ignore[attr-defined]

assert elastic_pen.alpha == alpha # type: ignore[attr-defined]
assert elastic_pen.lasso_ratio == lasso_ratio # type: ignore[attr-defined]

0 comments on commit 7346dfc

Please sign in to comment.