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

📄 featselm.m

📁 模式识别工具箱。非常丰富的底层函数和常见的统计识别工具
💻 M
字号:
%FEATSELM Feature selection map% % [W,R] = FEATSELM(A,CRIT,METHOD,K,T,PAR1,...)% % INPUT% 	A      	Training dataset %   CRIT   	Name of criterion: 'in-in', 'maha-s', 'NN' or others (see FEATEVAL) %                                  or an untrained classifier V (default: 'NN')%   METHOD  - 'forward' : selection by featself (default)% 	        - 'float'   : selection by featselp% 	        - 'backward': selection by featselb% 	        - 'b&b'     : branch and bound selection by featselo% 	        - 'ind'     : individual% 	        - 'lr'			: plus-l-takeaway-r selection by featsellr%   K      	Desired number of features (default: K = 0, return optimal set)%   T      	Tuning set to be used in FEATEVAL (optional)%   PAR1,.. Optional parameters:% 	        - L,R				: for 'lr' (default: L = 1, R = 0)%% OUTPUT%   W       Feature selection mapping%   R       Matrix with step by step results     %% DESCRIPTION% Computation of a mapping W selecting K features. This routines offers a% central interface to all other feature selection methods. W can be used% for selecting features in a dataset B using B*W.% % SEE ALSO% MAPPINGS, DATASETS, FEATEVAL, FEATSELO, FEATSELB, FEATSELI,% FEATSELP, FEATSELF, FEATSELLR% Copyright: R.P.W. Duin, duin@ph.tn.tudelft.nl% Faculty of Applied Sciences, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlands% $Id: featselm.m,v 1.4 2007/06/05 12:43:35 duin Exp $function [w,res] = featselm(a,crit,arg3,ksel,t,par1,par2)	prtrace(mfilename);		if (nargin < 2 | isempty(crit))    prwarning(2,'criterion not specified, assuming NN');		crit = 'NN';        	end	if (nargin < 3 | isempty(arg3))    prwarning(2,'method not specified, assuming forward');		arg3 = 'forward'; 	end	if (nargin < 4)		ksel = [];	end	if (nargin < 5)    prwarning(3,'no tuning set supplied (risk of overfit)');		t = [];             	end	if (nargin < 6), par1 = []; end;	if (nargin < 7), par2 = []; end;	% If no arguments are supplied, return an untrained mapping.	if (nargin == 0) | (isempty(a))		w = mapping('featselm',{crit,arg3,ksel,t,par1,par2});		w = setname(w,'Feature Selection');		return	end	a = testdatasize(a);	[m,k] = size(a);	if (isstr(arg3))		method = arg3;												% If the third argument is a string,		switch (method)												%   it specifies the method to use.		 case {'forward','featself'}													  [w,res] = featself(a,crit,ksel,t);		 case {'float','featselp'}		  [w,res] = featselp(a,crit,ksel,t);		 case {'backward','featselb'}		  [w,res] = featselb(a,crit,ksel,t);		 case {'b&b','featselo'}		  [w,res] = featselo(a,crit,ksel,t);		 case {'ind','featseli'}		  [w,res] = featseli(a,crit,ksel,t);		 case {'lr','featsellr'}		  [w,res] = featsellr(a,crit,ksel,par1,par2,t);		 otherwise		  error('Unknown method specified.')		end	elseif (ismapping(arg3))										w = arg3;														% If the third argument is a mapping,		isuntrained(w);											%  assert it is untrained and train		[w,res] = feval(mfilename,a,crit,w.mapping_file,ksel,t,par1,par2);	else		error('Illegal method specified.')	endreturn

⌨️ 快捷键说明

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