Last active
October 16, 2021 08:02
-
-
Save im-noob/ae2e0923b1e104486c67e971428ba1cc to your computer and use it in GitHub Desktop.
Grid Search CV
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
param_grid = { | |
'weights' : ['uniform', 'distance'], | |
'algorithm' : ['auto', 'ball_tree', 'kd_tree', 'brute'], | |
'leaf_size' : [30, 40, 50], | |
'n_neighbors' : [5, 10, 15], | |
} | |
gridSearchCV = GridSearchCV(KNeighborsRegressor(),param_grid=param_grid,n_jobs=-1) | |
----------------------------------------------------------------------------------------------- | |
param_grid = { | |
'fit_intercept' : [True, False], | |
'normalize' : [True, False], | |
'max_iter' : [1000, 2000], | |
'warm_start' : [True, False], | |
} | |
gridSearchCV = GridSearchCV(Lasso(),param_grid=param_grid,n_jobs=-1) | |
----------------------------------------------------------------------------------------------- | |
param_grid = { | |
'C': [0.001,0.01,0.1,1,10,100,1000], | |
'fit_intercept' : [True, False], | |
'solver' : ['newton-cg', 'lbfgs', 'liblinear'], | |
'max_iter': [100,200] | |
} | |
gridSearchCV = GridSearchCV(LogisticRegression(),param_grid=param_grid,n_jobs=-1) | |
----------------------------------------------------------------------------------------------- | |
----------------------------------------------------------------------------------------------- | |
----------------------------------------------------------------------------------------------- | |
----------------------------------------------------------------------------------------------- | |
----------------------------------------------------------------------------------------------- | |
----------------------------------------------------------------------------------------------- | |
----------------------------------------------------------------------------------------------- | |
----------------------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment