logo

... scikit dummy: comparison



Notes

Let's run a dummy model in a gridsearch so we can compare with our original result.

pipe = Pipeline([
    ('scale', StandardScaler()),
    ('model', DummyClassifier())
])

grid = GridSearchCV(estimator=pipe, 
                    param_grid={'model__strategy': ['stratified', 'most_frequent', 'uniform']}, 
                    cv=5, 
                    scoring={'acc': make_scorer(accuracy_score)}, 
                    refit='acc', 
                    return_train_score=True)

grid.fit(X, y);

To see the gridsearch results you can run;

pd.DataFrame(grid.cv_results_)[['param_model__strategy', 'mean_test_acc']]

Feedback? See an issue? Something unclear? Feel free to mention it here.



If you want to be kept up to date, consider signing up for the newsletter.