finding classifier performance in MATLAB

조회 수: 2 (최근 30일)
Ramya Mohan
Ramya Mohan 2013년 2월 4일
편집: Walter Roberson 2016년 11월 14일
I want to classify the breast cancer dataset using SVM.
I divide the 569 instances into 5 sets of data and groups, then use classperf function to compute the performance, but I don't know what arguments are to be given in classperf function. Pls help me.
============================================================
clc;clf;clear all;close all;
data=xlsread('DATACANCER.XLSX');
load clasy;
i=24;
j=25;
data = [data(:,i), data(:,j)];
A1= data(1:113,:);A2=data(114:226,:);A3=data(227:340,:);A4=data(341:454,:);A5=data(455:569,:);
groups = ismember(species,'B');
[train, test] = crossvalind('holdOut',groups,0.2);
G1=groups(1:113,:);G2=groups(114:226,:);G3=groups(227:340,:);G4=groups(341:454,:);G5=groups(455:569,:);
cp = classperf(groups);
figure
svmStruct = svmtrain(A1,G1,'showplot',true);
title(sprintf('Kernel Function: %s',...
func2str(svmStruct.KernelFunction)),...
'interpreter','none');
classes = svmclassify(svmStruct,A2,'showplot',true);
classperf(cp,classes,----);<--------HERE IS MY DOUBT
ans1=cp.CorrectRate*100;
disp(ans1);
cp
figure
svmStruct = svmtrain(A2,G2,'showplot',true);
title(sprintf('Kernel Function: %s',...
func2str(svmStruct.KernelFunction)),...
'interpreter','none');
classes = svmclassify(svmStruct,A3,'showplot',true);
classperf(cp,classes,----);<--------HERE IS MY DOUBT
ans2=cp.CorrectRate*100;
disp(ans2);
cp
figure
svmStruct = svmtrain(A3,G3,'showplot',true);
title(sprintf('Kernel Function: %s',...
func2str(svmStruct.KernelFunction)),...
'interpreter','none');
classes = svmclassify(svmStruct,A4,'showplot',true);
classperf(cp,classes,--------);<--------HERE IS MY DOUBT
ans3=cp.CorrectRate*100;
disp(ans3);
cp
figure
svmStruct = svmtrain(A4,G4,'showplot',true);
title(sprintf('Kernel Function: %s',...
func2str(svmStruct.KernelFunction)),...
'interpreter','none');
classes = svmclassify(svmStruct,A5,'showplot',true);
classperf(cp,classes,-------);<--------HERE IS MY DOUBT
ans4=cp.CorrectRate*100;
disp(ans4);
cp
figure
svmStruct = svmtrain(A5,G5,'showplot',true);
title(sprintf('Kernel Function: %s',...
func2str(svmStruct.KernelFunction)),...
'interpreter','none');
classes = svmclassify(svmStruct,A1,'showplot',true);
classperf(cp,classes,-------);<--------HERE IS MY DOUBT
ans5=cp.CorrectRate*100;
disp(ans5);
cp

답변 (0개)

카테고리

Help CenterFile Exchange에서 Biotech and Pharmaceutical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by