- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2019 06:07 PM
# Create the model using sklearn (don't worry about the parameters for now): model = SGDRegressor(loss='squared_loss', verbose=0, eta0=0.0003, max_iter=3000)
Train/fit the model to the train-part of the dataset:odel.fit(X_train, y_train)
ERROR:
TypeError: init() got an unexpected keyword argument 'max_iter'
TypeError Traceback (most recent call last) <command-894361499296960> in <module>() 1 # Create the model using sklearn (don't worry about the parameters for now): ----> 2 model = SGDRegressor(loss='squared_loss', verbose=0, eta0=0.0003, max_iter=3000) 3 4 # Train/fit the model to the train-part of the dataset: 5 model.fit(X_train, y_train)
TypeError: init() got an unexpected keyword argument 'max_iter'
I m running the linear regression code in Community edition.
Google says reinstall --
pip install scikit-learn==0.18 --force-reinstall
How to re-install in notebook?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 05:29 AM
Try replacing the failing line with the following:
model = SGDRegressor(loss='squared_loss', verbose=0, eta0=0.0003, n_iter=3000)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2019 06:08 PM
I m running the linear regression code in Community edition.
Google says reinstall --
pip install scikit-learn==0.18 --force-reinstall
How to re-install in notebook?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 05:29 AM
Try replacing the failing line with the following:
model = SGDRegressor(loss='squared_loss', verbose=0, eta0=0.0003, n_iter=3000)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019 03:55 AM
Replacing max_iter with n_iter resolves the error. Thnx!
It is a bit unusual to expect errors like this with this type of solution from Microsoft. As if it could not be prevented..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2021 11:54 PM
Thank you for your share.It is nice. Ancestormoneyshop

