Skip to main content
. 2024 Feb 21;24(5):1399. doi: 10.3390/s24051399
Algorithm 1 Serial implementation of Support Vector Machine
Input: γ → Kernel parameter
DCij → Dual coefficients matrix
wi → Support vectors matrix
x → Pixel to classify
b → Bias
1: Step 1:Kernel calculation
2: for i=0 to nsv1
3:       Kwi,x=expγwix2;
4: end
5: Step 2:Distance of the sample from the hyperplane 
6: for i=0 to nclass1
7:        for j=i+1 to nclass1
8:          dij=iSVDCijK(wi,x)+b;
9:       end
10: end
11: Step 3: “One vs. one” strategy
12: for i=0 to nclass1
13:       scorei=0
14:        for j=i+1 to nclass1
15:             ifdij>0
16:                    scorei++;
17:             else
18:                   scorej++;
19:       end
20: end
21:  Find imax, index of the scorei maximum
Output: imax