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

📄 gendatt.m

📁 模式识别 MATLAB 的工具箱,比较实用,包括SVM,ICA,PCA,NN等等模式识别算法.
💻 M
字号:
%GENDATT Generation of a test set out of a given data set% % 	X = gendatt(A,n,method,p1,p2)% % Generate from the given dataset A n vectors per class in X using % one of the following methods (n may be a vector with one component % per class): % % 	method = 'parzen' : ml parzen density estimation for each of% 		the classes separately. (use of gendatp)% 	method = 'knn ' : nearest neighbour generation per class% 		using gendatk. % % p1 and p2 are optional parameters tuning the methods (smoothing % parameter for parzen and number of neighbours and standard % deviation for knn).% % See also datasets, gendatk, gendatp% 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 [x,labx] = gendatt(a,n,meth,p1,p2)[nlab,lablist,m,k,c,prob,featlist] = dataset(a);if nargin < 5, p2 = 1; endif nargin < 4, p1 = 0; endif nargin < 3, meth='parzen'; endif nargin < 2, n = 100; endif length(n) == 1, n = n(1,ones(1,c)); endlabx = [];x = [];for j = 1:c	J = find(nlab==j);	if strcmp(meth,'parzen')		y = gendatp(+a(J,:),n(j),p1);	elseif strcmp(meth,'knn')		if p1 == 0, p1 = 1; end		y = gendatk(+a(J,:),n(j),p1,p2);	end	laby = repmat(lablist(j,:),n(j),1);	x = [x;y];	labx = [labx;laby];endif nargout == 1	x = dataset(x,labx,featlist,prob);end

⌨️ 快捷键说明

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