Skip to content
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

chapter 4: SGDRegressor(tol=-np.infty) is not accepted by the module #684

Open
FranciscoFang opened this issue Oct 13, 2023 · 1 comment

Comments

@FranciscoFang
Copy link

hi Aurelien,
i've read the code of In[46], chapter4, but when i copied the code to jupyter and then it turned out to be an error like:
"InvalidParameterError: The 'tol' parameter of SGDRegressor must be a float in the range [0.0, inf) or None. Got -inf instead.
"
i've already knew the SGDRegressor has a default value of 1e-03, but would you like to explain the error and what's your purpose of -np.infty?
thank you very much for your patience.
Francisco

@patmull
Copy link

patmull commented Oct 24, 2023

I was able to do this with the tol set to None and early_stopping=False:

sgd_reg = SGDRegressor(max_iter=1, tol=None, early_stopping=False, warm_start=True, penalty=None, learning_rate="constant", eta0=0.0005, n_iter_no_change=5000, random_state=42)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants