New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: reflexion about tol #125
Comments
you need to scale the tol so you have the same number of iterations if you
scale Y differently.
if you don't and you divide Y by 1e6 then the solver will run much faster
for no good reason.
+1 to raise a warning if tol < 1e-7 and you use float32
… |
@agramfort in sklearn the scaling should be by If I fit with taller and taller I think for usability it's best to go sklearn's way, but this is not the correct way IMO. @QB3 as we discussed |
are you sure as the cython code where the scaling is done takes alpha already scaled by n_samples. did you write a tiny script to demonstrate the claim? |
Summary: when you increase
Output:
|
I agree with @mathurinm on that point. |
From the user point of view I would say that choosing the tol as in sklearn is the best. If one uses a Lasso as a block in a pipeline, one does not want to change parameters (he/she probably does not understand well). IMO user should just have to change the import of the Lasso solver, not the tol. |
ok got it.
I think you can make a case that it's a bug fix in sklearn and also the
docstring
could be clarified that the tol a relative tolerance. I did this as an
intuition many
years ago but explaining this as a relative tolerance makes it simpler to
explain
… |
behaviour disagrees with sklearn because the latter scales tol by norm(y) ** 2 (or norm(y) ** 2 / n_samples ?)
using tol < 1e-7 with float32 caused precision issues (found out in
check_estimator
, MCVE:(casting X to float64 fixes it)
so maybe we can raise a warning if tol is low and X.dtype == np.float32
The text was updated successfully, but these errors were encountered: