SVM

조회 수: 1 (최근 30일)
C N N
C N N 2012년 1월 18일
Basically, i am using SVM for classificiation for images. I used Local Binary pattern for feature extraction. The problem i face is when i apply SVM the pred is always postive. It is not able to detect negative data.Although it shows me the accuracy value, but the pred label is always 1. It is a not able to detect negative data
clear all;
clc;
load('C:\Users\HP\Documents\MATLAB\TrainLabel');
load('C:\Users\HP\Documents\MATLAB\TrainVec');
cvFolds = crossvalind('Kfold', TrainLabel, 10);
cp = classperf(TrainLabel);
for i = 1:10
testIdx = (cvFolds == i);
trainIdx = ~testIdx;
Model = svmtrain(TrainVec(trainIdx,:), TrainLabel(trainIdx), ... 'Autoscale',true, 'Showplot',false, 'Method','QP', ... 'BoxConstraint',2e-1, 'Kernel_Function','rbf', 'RBF_Sigma',1);
pred = svmclassify(Model, TrainVec(testIdx,:),'Showplot',false);
cp = classperf(cp, pred, testIdx);
end
cp.CorrectRate
cp.CountingMatrix
The values for pred is [1;1;1;1;1;1] but my correctrate is 0.53(53%) and the TrainLabel is <267x1 double> and TrainVec is <267x1495 double>.
Any reason why this is so ? Need some help on it.
  댓글 수: 1
M@lik Ali
M@lik Ali 2012년 8월 28일
Hi CNN, I am also facing the problem of SVM. Can you upload here the TrainLabel and TrainVec Thanks in Advance.

댓글을 달려면 로그인하십시오.

답변 (1개)

dantuluri suryasree
dantuluri suryasree 2012년 3월 9일
hello , i am also working on the project my project is 2dpca and svm i have completed my pca for feature extraction but could not find any way to complete my svm for classification can u give me an idea of how do i proceed doing svm with feature vector

카테고리

Help CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by