I was trying to use scikit-learn package 0.24.2 with python-3.8.5 to do a grid search but I get the following error:
Error : Invalid parameter activation for estimator Pipeline(steps=[('scaler', StandardScaler()), ('MLPRegressor', MLPRegressor())]). Check the list of available parameters with
estimator.get_params().keys().
My code is the following:
mpl_pipe = Pipeline(steps=[
('scaler', StandardScaler()),
('MLPRegressor', MLPRegressor())
])
parameters = {
'hidden_layer_sizes': [(900,700,500,300,150,) ,(700,500,300,150, ),(500,300,150, ),(300,150, )],
'max_iter': [20000],
'activation' : ['identity', 'logistic', 'tanh', 'relu'],
'solver' : ['lbfgs', 'sgd', 'adam']
}
mlp_grid = GridSearchCV(mpl_pipe,
parameters,
cv = 5,
n_jobs = -1,
verbose=True)
mlp_grid.fit(x_train, y_train)
print(mlp_grid.best_score_)
print(mlp_grid.best_params_)