Support Vector Machines
I’ve heard many times about SVM before, but now I have witnessed its power. 😄
1.2.1 Gaussian Kernel
1 | sim = exp(-sum((x2-x1).^2)./(2*sigma.^2)); |
1.2.3 Example Dataset 3
1 | l = [0.01, 0.03, 0.1, 0.3, 1, 3, 10, 30]; |
I have written the Gaussian kernel function to accept sigma as a vector input and return a simulated vector, so g = gaussianKernel(x1, x2, s)
is a vector and it can skip the unnecessary calculation in the for c = l
loop for each s = l
. Then, if svmTrain
can be calculated as a vector, the for c = l
loop can also be skipped.
But it cannot. 😢
What does it have to do with functional programming?
2.1.1 Vocabulary List
1 | i = find(strcmp(vocabList, str)); |
2.2 Extracting Features from Emails
1 | for i = word_indices |
Translated by gpt-3.5-turbo