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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
conda install rpy2 -c conda-forge
pip install statsmodels cvxopt
pip install git+https://github.com/jolars/sortedl1.git
pip install sortedl1
# for testing Cox estimator
pip install lifelines
pip install pandas
Expand Down
6 changes: 4 additions & 2 deletions skglm/tests/test_penalties.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ def test_slope():
# q = 0.1
# alphas = lambda_sequence(
# X, y, fit_intercept=False, reg=alpha / alpha_max, q=q)
clf = SlopeEst(alpha=0.01, fit_intercept=False).fit(X, y)
clf = SlopeEst(
alpha=0.01, fit_intercept=False, tol=1e-6
).fit(X, y)
alphas = clf.lambda_
ours = GeneralizedLinearEstimator(
penalty=SLOPE(clf.alpha * alphas),
solver=FISTA(max_iter=1000, tol=tol, opt_strategy="fixpoint"),
).fit(X, y)
np.testing.assert_allclose(ours.coef_, clf.coef_, rtol=1e-5)
np.testing.assert_allclose(ours.coef_, np.squeeze(clf.coef_), rtol=1e-3)


@pytest.mark.parametrize("fit_intercept", [True, False])
Expand Down
Loading