Machine Learning, Data Science, Python, Support Vector Machine, Artificial Intelligence.
= dict(gamma=gamma_range, C=C_range) cv = StratifiedShuffleSplit(n_splits=5, test_size=0.2, random_state=42) grid = GridSearchCV(SVC(), param_grid=param_grid, cv=cv) grid.fit(x_train, y_train) print( "The best parameters are %s with a score of %0.2f" % (grid.best_params_, grid.best_score_) ) And