Question 13
How many models with different combinations of parameter values will get trained in the following code?
from sklearn.model_selection import GridSearchCVfrom sklearn.linear_model import SGDRegressorfrom sklearn.datasets import load_diabetes
X, y = load_diabetes(return_X_y=True)
params = [ {'alpha': [0.01,0.1,1],'learning_rate': ['constant','optimal']}, {'loss' : ['squared_error', 'huber'], 'alpha': ↪ [0.0001,0.001],'learning_rate':['constant','invscaling']}]
grid= GridSearchCV(estimator= SGDRegressor(), param_grid = params, scoring = 'neg_mean_squared_error', return_train_score=True, verbose = 2, n_jobs= -1 )
grid.fit(X,y)10
12
14
16