Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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..

Risposte (1)

Abdul Hamzah
Abdul Hamzah il 4 Lug 2017
hello..anyone?

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by