mclassc.m

来自「模式识别工具箱,本人毕业论文时用到的,希望对大家有用!」· M 代码 · 共 39 行

M
39
字号
%MCLASSC Computation of multi-class classifier from 2-class discriminants%%	W = mclassc(A,classf)%% The untrained classifier classf is called to compute c classifiers% between each of the c classes in the dataset A and the remaining% c-1 classes. The result is stored in the combined classifier W.%% See also datasets, mappings% Copyright: R.P.W. Duin, duin@ph.tn.tudelft.nl% Faculty of Applied Physics, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlandsfunction w = mclassc(a,classf);if nargin < 2 | ~isa(classf,'mapping') | ~isuntrained(classf)	error('Second parameter should be untrained mapping')endif isempty(a)	w = mapping('mclassc',classf);	returnend[nlab,lablist,m,k,c] = dataset(a);if c == 1	error('Dataset should contain more than one class')endif c == 2	w = a*classf;	returnendw = [];for i=1:c	mlab = 2 - (nlab == i); 	v = dataset(a,mlab)*classf;	w = [w,mapping(v,lablist(i,:))];end

⌨️ 快捷键说明

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