diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8c41f0f..25b47b88 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/skglm/tests/test_penalties.py b/skglm/tests/test_penalties.py index 0f1bddd9..ad562923 100644 --- a/skglm/tests/test_penalties.py +++ b/skglm/tests/test_penalties.py @@ -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])