⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myprsvm.m

📁 模式识别,对iris数据进行分类,svm算法
💻 M
字号:
function SVMlabel=MyPRSVM(SV,Alpha,Thsvm,Testdata,Kerneltype,Sigma)
dim=size(SV,2);
Y=SV(:,1);
SV=SV(:,2:dim);
switch Kerneltype
    case 'linear'
        K=SV*Testdata';
    case 'poly'
        K=(SV*Testdata'+1).^2;
    case 'gauss'
        n=length(Y);
        tmp=zeros(n,1);
        for i=1:n
            t=SV(i,:)-Testdata;
            tmp(i,1)=-0.5*(t*t');
        end        
        K=exp(tmp./(Sigma.^2));
    otherwise
        K=0;
end
SVMlabel=Alpha.*Y.*K;
SVMlabel=sum(SVMlabel)+Thsvm;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -