I am running into the problem that the hyperparameters of my svm.SVC()
are too wide such that the GridSearchCV()
never gets completed! One idea is to u
Which kernel works best depends a lot on your data. What is the number of samples and dimensions and what kind of data do you have? For the ranges to be comparable, you need to normalize your data, often StandardScaler, which does zero mean and unit variance, is a good idea. If your data is non-negative, you might try MinMaxScaler.
For kernel="gamma"
, I usually do
{'C': np.logspace(-3, 2, 6), 'gamma': np.logspace(-3, 2, 6)}
which is based on nothing but served me well the last couple of years. I would strongly advice against non-logarithmic grids, and even more though against randomized search using discrete parameters. One of the main advantages of randomized search is that you can actually search continuous parameters using continuous distributions [see the docs].