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

📄 svmmulticlass.m

📁 我用于脑机接口P300拼写范例中的程序
💻 M
字号:
function [xsup,w,b,nbsv,pos,alpha]=svmmulticlass(x,y,nbclass,C,epsilon,kernel,kerneloption,verbose, alphainit)% USAGE %[xsup,w,b,nbsv,pos,alpha]=svmmulticlass(x,y,nbclas,C,epsilon,kernel,kerneloption,verbose, alphainit)%% Support vector machine for multiclass CLASSIFICATION% This routine classify the training set with a support vector machine% using quadratic programming algorithm (active constraints method)%% INPUT%% Training set%      x  		: input data %      y  		: output data% parameters%		c		: Bound on the lagrangian multipliers     %		lambda		: Conditioning parameter for QP method%		kernel		: kernel  type. classical kernel are%%		Name			parameters%		'poly'		polynomial degree%		'gaussian'	gaussian standard deviation
%
%		for more details see svmkernel% %		kerneloption : parameters of kernel
%
%		for more details see svmkernel%% 		verbose : display outputs (default value is 0: no display)%
%       alphainit : initialization vector of QP problem%% OUTPUT%% xsup	coordinates of the Support Vector% w      weight% b		bias% pos    position of Support Vector% alpha  Lagragian multiplier%%% see also svmreg, svmkernel, svmval%	06/01/2003 Alain Rakotomamonjy%%       scanu@insa-rouen.fr, alain.rakoto@insa-rouen.frif nargin< 7    alphainit=[];end;if nargin < 6    verbose = 0;endif nargin < 5    kerneloption = 1;endif nargin < 4    kernel = 'gaussian';endif nargin < 3    lambda = 0.000000001;endif nargin < 2    C = 100000;end%------------------------------------------------------% initialisation%-------------------------------------------------------[y,ind]=sort(y);x=x(ind,:);yextended=repmat(y,nbclass,1);xextended=repmat(x,nbclass,1);ell=size(x,1);n=sum(y==1);if size(C,1)==1    C=C*ones(size(y));end;%------------------------------------------------------% construction des matrices associ

⌨️ 快捷键说明

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