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

📄 pbayescln.m

📁 bayeserr - Computes the Bayesian risk for optimal classifier. % bayescln - Classifier based on Baye
💻 M
字号:
function pbayescln(MI,SIGMA,Pk,background, linestyle)% PBAYESCLN vizualizes Bayes classifier discriminant in 2D.%  pbayescln(MI,SIGMA,Pk,background, linestyle )%% This fucntion vizualizes discriminant functions of % Bayes classifier (see help bayescln). %% Intput:%  (notation: K - number of classes)%  MI [2xK] Matrix of K vectors of mean values of p(x|k).%    MI=[mi_1,mi_2,...,mi_K], where mi_j is a column vector [Nx1] for %    class j.%  SIGMA [(2x2)xK] Matrix of covariance matrices of the density p(x|k).%    SIGMA=[sigma_1,sigma_2,...,sigma_K], sigma_j is the covariance%    matrix corresponding to the class j.%  Pk [1xK] Vector with a priori probability densities. Pk(j) is an%    a priori probability of class j.%  background [1x1] if is 0 then only the border (discriminat fce = 0) %    is displayed. If is 1 (default) then the colors of background %    correspond to values of discriminant function. %  linestyle [string] used line style (see help plot).%% Output:%  Graph to current figure.% % See also BAYESCLN, PDISCRIM.% % Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz% Written Vojtech Franc (diploma thesis) 23.12.1999, 5.4.2000% Modifications% 20-may-2001, V. Franc, createdif nargin < 4 | isempty(background),  background = 1;endif nargin < 5,  linestyle = 'k';end% gridGRIDX=50;GRIDY=50;if nargin < 3,   error('Not enough input arguments.');   return;endV = axis;dx = (V(2)-V(1))/GRIDX;dy = (V(4)-V(3))/GRIDY;[X,Y] = meshgrid(V(1):dx:V(2),V(3):dy:V(4));% make testing pointsXtst=[reshape(X',1,prod(size(X)));reshape(Y',1,prod(size(Y)))];% classify points[Ixy, D] = bayescln(Xtst,MI,SIGMA,Pk);pdiscrim( D, V(1):dx:V(2), V(3):dy:V(4), background, linestyle );axis(V);return;

⌨️ 快捷键说明

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