Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created January 25, 2021 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/25c07f676ebbbe50e6731da481cdad3d to your computer and use it in GitHub Desktop.
Save amankharwal/25c07f676ebbbe50e6731da481cdad3d to your computer and use it in GitHub Desktop.
from sklearn.model_selection import GridSearchCV
param_grid = {'C': [0.1,1, 10, 100], 'gamma': [1,0.1,0.01,0.001]}
grid = GridSearchCV(SVC(),param_grid,refit=True,verbose=2)
grid.fit(X_train,y_train)
grid_predictions = grid.predict(X_test)
print(confusion_matrix(y_test,grid_predictions))
print(classification_report(y_test,grid_predictions))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment