Skip to content

Commit

Permalink
updated python versions the unit tests run for
Browse files Browse the repository at this point in the history
  • Loading branch information
lennybronner committed Sep 19, 2023
1 parent 21cdfbc commit fde1457
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/test_ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_random_weights_intercept(random_data_weights):
def test_regularizer():
lm = OLSRegressionSolver()

lambda_I = lm._get_regularizer(7, 10, fit_intercept=True, regularize_intercept=True, n_feat_ignore_req=2)
lambda_I = lm._get_regularizer(7, 10, fit_intercept=True, regularize_intercept=True, n_feat_ignore_reg=2)

assert lambda_I.shape == (10, 10)
assert lambda_I[0, 0] == pytest.approx(7)
Expand All @@ -143,7 +143,7 @@ def test_regularizer():
assert lambda_I[6, 6] == pytest.approx(7)
assert lambda_I[7, 7] == pytest.approx(7)

lambda_I = lm._get_regularizer(7, 10, fit_intercept=True, regularize_intercept=False, n_feat_ignore_req=2)
lambda_I = lm._get_regularizer(7, 10, fit_intercept=True, regularize_intercept=False, n_feat_ignore_reg=2)

assert lambda_I.shape == (10, 10)
assert lambda_I[0, 0] == pytest.approx(0)
Expand Down Expand Up @@ -176,7 +176,7 @@ def test_regularization_with_intercept_and_unreg_feature(random_data_no_weights)

lm = OLSRegressionSolver()
lambda_ = 1e6
lm.fit(x, y, lambda_=lambda_, fit_intercept=True, regularize_intercept=False, n_feat_ignore_req=2)
lm.fit(x, y, lambda_=lambda_, fit_intercept=True, regularize_intercept=False, n_feat_ignore_reg=2)
coefficients_w_reg = lm.coefficients
assert all(np.abs(coefficients_w_reg[3:] - [0, 0]) <= TOL)
assert np.abs(coefficients_w_reg[0]) > TOL
Expand All @@ -191,7 +191,7 @@ def test_regularization_with_intercept_but_no_intercept_reg_and_unreg_feature(ra

lm = OLSRegressionSolver()
lambda_ = 1e6
lm.fit(x, y, lambda_=lambda_, fit_intercept=True, regularize_intercept=True, n_feat_ignore_req=2)
lm.fit(x, y, lambda_=lambda_, fit_intercept=True, regularize_intercept=True, n_feat_ignore_reg=2)
coefficients_w_reg = lm.coefficients
assert all(np.abs(coefficients_w_reg[3:] - [0, 0]) <= TOL)
assert np.abs(coefficients_w_reg[0]) < TOL
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py{3}
envlist=py3.10,py3.11
skipdist=True

[base]
Expand Down

0 comments on commit fde1457

Please sign in to comment.