Skip to content Skip to sidebar Skip to footer

Grid Search Error

I've been trying to perform a grid search, but something seems to be off. My code is: grid_search_0 = GridSearchCV(estimator=Pipeline([('vectorizer', CountVectorizer()), ('tfidf',

Solution 1:

This is what the error message suggests doing, does this work for you?

if__name__== '__main__':

    grid_search_0 = GridSearchCV(estimator=Pipeline([('vectorizer', CountVectorizer()), ('tfidf', TfidfTransformer()), ('clf', LinearSVC())]),
             param_grid={'C': 3**np.arange(-3, 3, dtype='float'),
                         'gamma': 3**np.arange(-6, 0, dtype='float'), },
             cv=10,
             scoring=make_scorer(roc_auc_score, needs_threshold=True),
             verbose=1,
             n_jobs=-1)

for more on why this is important, see this Stack Overflow question/answer

Post a Comment for "Grid Search Error"