handson-ml2 icon indicating copy to clipboard operation
handson-ml2 copied to clipboard

sgd regressor

Open saranyapuvvada opened this issue 3 years ago • 1 comments

NameError Traceback (most recent call last) in ----> 1 sgd_reg = SGDRegressor(penalty="l2", max_iter=1000, tol=1e-3, random_state=42) 2 sgd_reg.fit(X, y.ravel()) 3 sgd_reg.predict([[1.5]])

NameError: name 'SGDRegressor' is not defined

saranyapuvvada avatar Sep 27 '22 16:09 saranyapuvvada

Hi @saranyapuvvada , The error message indicates that the name 'SGDRegressor' is not defined. This is probably because it was not imported. Please run:

from sklearn.linear_model import SGDRegressor

When you run into an issue, please try running the official notebook, and see if you still get the error. If the error disappears, then it must be because the code you ran was different or missing something.

Hope this helps.

ageron avatar Sep 27 '22 23:09 ageron