[need help] how to improve non-linear result of svmtrain with grid search
1 view (last 30 days)
Show older comments
hello everyone, i have a problem with the result of svmtrain function on matlab and i would like to improve the result with grid search. My code is as follows :
clc;
clear;
close all;
%load data
data = load('database.mat','data');
data_train = (data.data(1:355,:));
data_test = (data.data(356:442,:));
%load class
class = 'E:\target.xlsx';
%taking the matrix
train_class = xlsread(class,'A1:A355');
test_class = xlsread(class,'A356:A442');
%crossvalidation SVM
cvFolds = crossvalind('kFold',train_class,70);
cp = classperf(train_class);
for i = 1:70
testIdx = (cvFolds == i);
trainIdx = ~testIdx;
model= svmtrain(data_train(trainIdx,:),train_class(trainIdx),...
'kernelcachelimit',100000,'kernel_function','polynomial','polyorder',4);
end
class_predict = svmclassify(model,data_test);
c = confusionmat(test_class, class_predict);
acc = sum(diag(c))/sum(c(:)); %accuracy
the accuracy is still below 90 percent so i want to improve it more by using grid search, to get the most optimum accuracy..do you know how to do that? or is there a better method than grid search? thx before..
0 Comments
Answers (1)
See Also
Categories
Find more on Direct Search in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!