[need help] how to improve non-linear result of svmtrain with grid search

조회 수: 4 (최근 30일)
Abdul Hamzah
Abdul Hamzah 2017년 7월 4일
답변: Abdul Hamzah 2017년 7월 4일
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..

답변 (1개)

Abdul Hamzah
Abdul Hamzah 2017년 7월 4일
hello..anyone?

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by