Skip to content

why gridsearchCV becomes much slower when migrating into model_selection? #8918

@cqcn1991

Description

@cqcn1991

Originally, I used

from sklearn.grid_search import GridSearchCV

to perform gridsearch on KDE, part of the code would look like this:

 grid = GridSearchCV(neighbors.KernelDensity(kernel = KDE_KERNEL),
                    {'bandwidth': bandwidth_range}, n_jobs=-1, cv=4) 

 grid.fit(bandwidth_search_sample)

Recently, the scikit-learn moved the module. It becomes

from sklearn.model_selection import GridSearchCV

The API is still the same, but after I switch to the new model_selection.GridSearchCV, the speed slowed dramatically. For one dataset that I used, it is from 18.4s to 1min 21s.

What is happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions