-
-
Save osin-vladimir/af91fe6e358767ec8334 to your computer and use it in GitHub Desktop.
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
| # set parameters for grid search | |
| parameters_dtc = { | |
| 'max_depth': list(range(1,20)), | |
| 'criterion': ['gini', 'entropy'], | |
| 'splitter': ['best', 'random'], | |
| 'max_features' : list(range(1,15)) | |
| } | |
| gs = GridSearchCV(DTC(), param_grid = parameters_dtc, cv = cv) | |
| #mesure time of search | |
| start_time = timer() | |
| gs.fit(X, y) | |
| time_delta = timer() - start_time | |
| print("Best score: %s" % gs.best_score_) | |
| print ("Best parameters: %s" % gs.best_params_) | |
| print("Time of grid search: ", time_delta) | |
| print("Accuracy metric: ", compute_accuracy(X,y,gs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment