-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GridSearch and skdag #32
Comments
Hi, can you share your full code? There's no |
Hi, from sklearn import datasets X, y = datasets.load_diabetes(return_X_y=True, as_frame=True) dag = ( from sklearn.ensemble import RandomForestClassifier y_pred = dag2.fit_predict(X_train, y_train) from sklearn.model_selection import GridSearchCV params = {'blood__n_components': [1,2,3,4]} Regards, |
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
The text was updated successfully, but these errors were encountered: