genprlablogo

%GENPRLABLOGO Generates Stochastic PRLab Logo
%
% GENPRLABLOGO(N,F)
%
% INPUT
% N Number of random peaking experiments performed to average over and
% produce the PRLab logo [default is 1000, approximately reproducing
% logo used for prlab.tudelft.nl]
% F If ~= 0 laboratory name is included in logo [default is 0]
%
% OUTPUT
% A figure with a single stochastic instantiation of the
% Pattern Recognition Laboratory logo
%
% DESCRIPTION
% The logo plots average learning curves both for the training set and for
% the test set and illustrates the peaking phenomenon that the Fisher
% classifier displays in the small sample case. Generating the logo
% relies on the PRTools toolbox [prtools.org].
%
% This must be one of the first, if not the first, stochastic logos around.
%
% REFERENCES
% 1. S. Raudys and R.P.W. Duin, On expected classification error of the
% Fisher linear classifier with pseudo-inverse covariance matrix, Pattern
% Recognition Letters, vol. 19, no. 5-6, 1998, 385-392.
% 2. R.A. Fisher, The use of multiple measurements in taxonomic problems,
% Annals of Eugenics, vol. 7, 1936, 179-188.
%
% SEE ALSO
% FISHERC, LDC, GENDATS, CLEVAL

% Copyright: M. Loog, m.loog@tudelft.nl
% Pattern Recognition Laboratory, Delft University of Technology
% P.O. Box 5031, 2600 GA Delft, The Netherlands

% $Id: genprlablogo.m,v 0.00 2015/03/29 18:51:48 mloog Exp $

function genprlablogo(N,flag)

if (nargin < 2)

flag = 0;

end

if (nargin < 1)

N = 1000;

end

figure
rep = N;
dim = 25;
dst = 2;
obj = unique(ceil(exp(linspace(log(1),log(20*dim),25))));
TRU = zeros(size(obj,2),rep);
APP = zeros(size(obj,2),rep);
E = eye(dim);

for i = 1:size(obj,2)

for j = 1:rep

trn = gendats([obj(i) obj(i)],dim,dst);
trn(:,1) = trn(:,1) - dst/2;
m = meancov(trn);
w = diff(+m,1,1)*pinv(cov(+trn));
w = w/norm(w);
thr = mean(+m*w',1);
TRU(i,j) = 0.5 - 0.5*erf(dst*w(1)/sqrt(8));
APP(i,j) = mean((+trn*w'>thr)+1 ~= getlab(trn));

end

end

X = log(obj)/max(log(obj));
X2 = [0 X 1];
e = 0.5 - 0.5*erf(2/sqrt(8));
e = e*ones(size(obj));
clr = 1-[0 166 214]/255; % 1 - TU Delft blue
fill(X2,[1 mean(TRU,2)' 1],clr,'EdgeColor',clr,'LineWidth',2)
hold on
fill(X2,[0 mean(APP,2)' 0],[0 0 0],'EdgeColor',[0 0 0],'LineWidth',2)
axis equal off

if flag

set(gcf,'Position',[100 502 1120 420])
set(gca,'Position',[-.2 0.11 0.775 0.815])
text(1,.865,'Pattern')
text(1,.515,'Recognition')
text(1,.165,'Laboratory')
h = get(gca,'Children');
set(h(1:3),'FontSize',105,'FontName','Tahoma')

end

return