SVM classification weight fitcsvm

조회 수: 33 (최근 30일)
Pegah Kassraian Fard
Pegah Kassraian Fard 2018년 6월 11일
댓글: Ramya k 2020년 12월 7일
Hi,
I am training a linear SVM classifier:
cvFolds = crossvalind('Kfold', labels, nrFolds);
for i = 1:nrFolds % iteratre through each fold
testIdx = (cvFolds == i); % indices of test instances
trainIdx = ~testIdx; % indices training instances
% train the SVM
% 'OptimizeHyperparameters','auto'
cl = fitcsvm(features(trainIdx,:), labels(trainIdx),'KernelFunction',kernel,'Standardize',true,...
'BoxConstraint',C,'ClassNames',[0,1], 'Solver', solver);
[labelPred,scores] = predict(cl, features(testIdx,:));
eq = sum(labelPred==labels(testIdx));
accuracy(i) = eq/numel(labels(testIdx));
end
As is obvious, the trained SVM model is stored in cl. Checking the model parameters in cl I do not see which parameters correspond to classifier weight - feedback much appreciated.
  댓글 수: 1
Ramya k
Ramya k 2020년 12월 7일
how to find Sensitivity of above code?

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

답변 (1개)

Prashant Lawhatre
Prashant Lawhatre 2018년 11월 17일
weight_vector=c1.Beta;
bais_vector=c1.Bias;

카테고리

Help CenterFile Exchange에서 Classification Learner App에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by