Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Jan 25, 2021
Embed
What would you like to do?
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