Skip to content

GridSearch and skdag #32

@TonciG

Description

@TonciG

Hi,

First of all, I think your library is a great add on to sklearn, especially since it addresses limitations of Pipeline.

Having said that, I tried to use skdag with GridSearchCV of sklearn but run into problem. I try to use one of your examples from the library docs (https://skdag.readthedocs.io/en/latest/quick_start.html) to do the grid search of optimal hyperparameter values. To you code I only add the following:
from sklearn.model_selection import GridSearchCV
params = {'blood__n_components': [1,2,3,4]}
grid = GridSearchCV(estimator = dag2, param_grid = params, scoring = 'accuracy')
grid.fit(X_train, y_train)

However, when I try to fit the model, I get the following error:
ValueError: Found input variables with inconsistent numbers of samples: [61, 2]

Would really appreciate if you could tell me what is going on here.
Regards,
Tonci

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