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

📄 exmulticlass1v1margdif.m

📁 关于svm的例程
💻 M
字号:
%
% Example MultiClass SVM Classifiction
% "One against One" with Feature Selection
%
%
%


close all
clear all
%--------------------------------------------------
n=50;
sigma=1;
x1=sigma*randn(1,n)-1.4;
x2=sigma*randn(1,n)+0;
x3=sigma*randn(1,n)+2;

y1=sigma*randn(1,n)-1.4;
y2=sigma*randn(1,n)+2;
y3=sigma*randn(1,n)-1.4;

xapp=[x1 x2 x3;y1 y2 y3]';
yapp=[1*ones(1,n) 2*ones(1,n) 3*ones(1,n)]';
nbclass=3;


%--------------- adding noisy variables-------------------------------------

xapp=[xapp 1*randn(n*nbclass,10)];
[n1, n2]=size(xapp);

%-----------------------------------------------------
%   Learning and Learning Parameters

lambda = 1e-7;
kerneloption= 1;                
kernel='gaussian';verbose = 0;
c=1000;
span=1;
%-----------------------------------------------------------------------%
%                       Feature Selection Settings                      %
%-----------------------------------------------------------------------%
featseloption.AlphaApprox=1;   % if zero, alpha is calculated at each step 
featseloption.RemoveChunks=1;
featseloption.StopChunks=10;
featseloption.FirstOrderMethod='scal';   % or 'grad', 'absscal' 'scal'
[RankedVariables,nbsvvec,Values]=FeatSelmargdif1v1(xapp,yapp,nbclass,c,kernel,kerneloption,verbose,span,featseloption)



⌨️ 快捷键说明

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