TypeError: 'Pipeline' object is not callable


preprocessor = ColumnTransformer([('numeric', num_pipe(Scaling = 'standard', poly = 3), X.columns)])

pipeline =Pipeline([("prep", preprocessor),
                    ("mlp", MLPRegressor(random_state=42))])

parameter = {
    "mlp__alpha": [0.0001, 0.0003, 0.001, 0.003],
    "mlp__hidden_layer_sizes": [(16, 8, 4), (16, 4), (8, 4)],
    "mlp__learning_rate_init": [0.001, 0.005, 0.01],
    "mlp__activation": ["identity"]
}

model_ANN = RandomizedSearchCV(pipeline, parameter, cv=3, n_iter=50, scoring = 'neg_mean_absolute_error', n_jobs=-1, verbose=1, random_state=42)
model_ANN.fit(X_train, y_train)

print(model_ANN.best_params_)
print(model_ANN.score(X_train, y_train), model_ANN.best_score_, model_ANN.score(X_test, y_test))
---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-37-8d973201cae2> in <module>()
----> 1 preprocessor = ColumnTransformer([('numeric', num_pipe(Scaling = 'standard', poly = 3), X.train)])
      2
      3 pipeline =Pipeline([("prep", preprocessor),
      4                     ("mlp", MLPRegressor(random_state=42))])
      5

TypeError: 'Pipeline' object is not callable
avatar qwerty28
@qwerty28

2 Kontribusi 0 Poin

Dipost 2 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban