# 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)
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?
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?
Answer by Daniel Holth · Aug 08 at 12:29 PM
Try replacing the failing line with the following:
model = SGDRegressor(loss='squared_loss', verbose=0, eta0=0.0003, n_iter=3000)
Answer by Fantomas_nl · Aug 13 at 10: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..
Spark.implicits in Python API 1 Answer
DROP TABLE IF EXISTS does not work 4 Answers
Write data Frame into Azure Data Lake Storage 2 Answers
How to work with spark-jobserver in azure databricks? 0 Answers
Why are Python custom UDFs (registerFunction) showing Arrays with java.lang.Object references? 1 Answer
Databricks Inc.
160 Spear Street, 13th Floor
San Francisco, CA 94105
info@databricks.com
1-866-330-0121