In [ ]:
from sklearn import svm
from sklearn.model_selection import GridSearchCV
In [ ]:
if 'features_train' not in locals() or globals():
%run ../dev/environment_setup2.ipynb
In [ ]:
parameters = [{'kernel': ['rbf'], 'gamma': [1e-3, 1e-4],
'C': [1, 10, 100, 1000]},
{'kernel': ['linear'], 'C': [1, 10, 100, 1000]}]
svr = svm.SVC()
clf = GridSearchCV(svr, parameters)
In [ ]:
grid_train_predict_fulldataset("SVM with GridSearchCV and FULL DATASET...")
sorted(clf.cv_results_.keys())
param = "Best Param: " + str(clf.best_params_)
print (param)
score = "Best Avarage Score: " + str(clf.best_score_)
print (score)