July 2017
Intermediate to advanced
382 pages
9h 13m
English
In order to test some of the SVM kernels we just talked about, we will return to our code sample mentioned earlier. We want to repeat the process of building and training the SVM on the dataset generated earlier, but this time we want to use a whole range of different kernels:
In [13]: kernels = [cv2.ml.SVM_LINEAR, cv2.ml.SVM_INTER,... cv2.ml.SVM_SIGMOID, cv2.ml.SVM_RBF]
Do you remember what all of these stand for?
Setting a different SVM kernel is relatively simple. We take an entry from the kernels list and pass it to the setKernels method of the SVM class. That's all.
The laziest way to repeat things is to use a for loop:
In [14]: for idx, kernel in enumerate(kernels):
Then the steps are ...
Read now
Unlock full access