grid = GridSearchCV(LogisticRegression(), param_grid, cv=5)
grid.fit(X_train, y_train)
vectorizer = grid.best_estimator_.named_steps["tfidfvectorizer"]
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
----> 1 vectorizer = grid.best_estimator_.named_steps["tfidfvectorizer"]
2 # transform the training dataset
3 X_train = vectorizer.transform(text_train)
...
AttributeError: 'LogisticRegression' object has no attribute 'named_steps'
Чем заменить named_steps?