ageron / handson-ml2

A series of Jupyter notebooks that walk you through the fundamentals of Machine Learning and Deep Learning in Python using Scikit-Learn, Keras and TensorFlow 2.
Apache License 2.0
28.07k stars 12.81k forks source link

sgd regressor #595

Open saranyapuvvada opened 2 years ago

saranyapuvvada commented 2 years ago

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

ageron commented 2 years ago

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.