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

📄 multic.m

📁 支持向量域是近几年采用的一种较新的分类器
💻 M
字号:
%MULTIC Make a multi-class classifier%%    W = MULTIC(A,V)%% Train the (untrained!) one-class classifier V on each of the classes% in A, and combine it to a multi-class classifier W. If an object is% rejected by all one-class classifiers, it will be classified% 'outlier'. If it is accepted by more than one one-class classifier, it% will be assigned to the class with the highest class posterior.%% Frustratingly, it can happen that the class labels are numbers. In% that case the outlier class will have a 0. For datasets with string% class labels, the outlier class will be called 'outlier'.%%    W = MULTIC(A,{V1 V2 ... VK})% % The trained one-class classifiers V1...VK are combined to a multiclass% classifier W.%% See also dd_normc, myproxm% Copyright: D.M.J. Tax, D.M.J.Tax@prtools.org% Faculty EWI, Delft University of Technology% P.O. Box 5031, 2600 GA Delft, The Netherlands  function w = multic(a,w)[n,k,c] = getsize(a);% Hmm, labels can be numbers... Make sure that the correct label for the% outlier class is used.ll = getlablist(a);if isa(ll,'double')%	rejlabel = max(ll)+1;	rejlabel = 0;else	rejlabel = [];end% Train the one-class classifiers (if needed) and fix the class labels% for the multi-class classifier.for i=1:c	x = target_class(a,i);	if length(w)==1		if istrained(w)			error('Please supply one untrained one-class mapping.');		end		W{i} = x*w*dd_normc;	else		if isuntrained(w{i})			W{i} = x*w{i}*dd_normc;		else			W{i} = w{i};		end	end	if isempty(rejlabel)		W{i} = setlabels(W{i},ll(i,:),1);	else		W{i} = setlabels(W{i},[ll(i); rejlabel]);	endend% The final classifier is a fixed combiner:w = [W{:}]*minc;return

⌨️ 快捷键说明

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