Skip to content

Commit ba3d6b8

Browse files
adress remaining comments, loosen tolerance, warnings are still there
1 parent 34b083d commit ba3d6b8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

skglm/experimental/quantile_huber.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def fit(self, X, y):
163163
# Use AndersonCD solver
164164
solver = AndersonCD(max_iter=self.max_iter, tol=self.tol,
165165
warm_start=True, fit_intercept=self.fit_intercept,
166-
verbose=3)
166+
verbose=max(0, self.verbose - 1))
167167

168168
est = GeneralizedLinearEstimator(
169169
datafit=datafit, penalty=penalty, solver=solver)

skglm/experimental/tests/test_quantile_huber.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import numpy as np
23
from numpy.testing import assert_allclose
34
from sklearn.linear_model import QuantileRegressor
45
from sklearn.datasets import make_regression
@@ -20,10 +21,15 @@ def test_quantile_huber_matches_sklearn(quantile, fit_intercept):
2021
delta_init=0.5,
2122
delta_final=0.00001,
2223
n_deltas=15,
23-
verbose=True,
24+
verbose=False,
2425
fit_intercept=fit_intercept,
2526
).fit(X, y)
2627

27-
assert_allclose(smooth_est.coef_, sk_est.coef_, atol=1e-4)
28+
assert not np.allclose(sk_est.coef_, 0, atol=1e-8), (
29+
"All coefficients in sk_est are (near) zero: alpha may be too high.")
30+
assert not np.allclose(smooth_est.coef_, 0, atol=1e-8), (
31+
"All coefficients in smooth_est are (near) zero: alpha may be too high.")
32+
33+
assert_allclose(smooth_est.coef_, sk_est.coef_, atol=1e-3)
2834
if fit_intercept:
29-
assert_allclose(smooth_est.intercept_, sk_est.intercept_, atol=1e-4)
35+
assert_allclose(smooth_est.intercept_, sk_est.intercept_, atol=1e-3)

0 commit comments

Comments
 (0)