?? exmulticlass1v1margdif.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)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -