-
-
Save mprzybyla123/663dfc57b5cf6fcdd45b4a06ce82afb3 to your computer and use it in GitHub Desktop.
grid-search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unite the features and classifier together | |
pipe = Pipeline([('features', features), | |
('clf',clf) | |
]) | |
# create grid | |
param_grid = { | |
'n_estimators': [200, 300, 400], | |
'max_features': ['auto', 'sqrt', 'log2'], | |
'max_depth' : [4,6,8,10,20], | |
'criterion' :['gini', 'entropy'] | |
} | |
# apply grid to model | |
search = GridSearchCV(pipe, param_grid, cv=2).fit(X, y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment