I found a SVM example online. I do not understand why only count the first two columns of features. The data set is famous "spiral_Nc10_train.mat" and "spiral_Nc10_train.mat". "spiral_Nc10_train.mat" contains 1) data = 1000*3 double; 2) label = 1000*1 double. "spiral_Nc10_test.mat" contains 1) data = 500*3 double; 2) label = 500*1 double. The part of the original code looks like this:
load(fullfile(dirData,'spiral_Nc10_train'));
rawTrainData = data(:,1:2); (line 2)
rawTrainLabel = label;
NTrain = size(rawTrainData,1);
[sortedTrainLabel, permIndex] = sortrows(rawTrainLabel);
sortedTrainData = rawTrainData(permIndex,:);
load(fullfile(dirData,'spiral_Nc10_test'));
rawTestData = data(:,1:2); (line 8)
rawTestLabel = label;
NTest = size(rawTestData,1);
[sortedTestLabel, permIndex] = sortrows(rawTestLabel);
sortedTestData = rawTestData(permIndex,:);
I try to change line 2 and line 8 to the following:
rawTrainData = data(:,1:3);
rawTestData = data(:,1:3);
But the result is wrong and the final predict label is also wrong. Can anyone tell me why SVM can only apply to 2 columns features? Thank you so much!