Speed of SVM Kernels? Linear vs RBF vs Poly
I'm using scikitlearn in Python to create some SVM models while trying different kernels. The code is pretty simple, and follows the form of: from sklearn import svm clf = svm.SVC(kernel='rbf', C=1, gamma=0.1) clf = svm.SVC(kernel='linear', C=1, gamma=0.1) clf = svm.SVC(kernel='poly', C=1, gamma=0.1) t0 = time() clf.fit(X_train, y_train) print "Training time:", round(time() - t0, 3), "s" pred = clf.predict(X_test) The data is 8 features and a little over 3000 observations. I was surprised to see that rbf was fitted in under a second, whereas linear took 90 seconds and poly took hours. I