Code covered by the BSD License

Highlights from Fischer Linear Dicriminant Analysis

Be the first to rate this file! 33 Downloads (last 30 days) File Size: 3.04 KB File ID: #38950

Fischer Linear Dicriminant Analysis

Sergios Petridis (view profile)

07 Nov 2012 (Updated )

find the discriminative susbspace for samples using fischer linear dicriminant analysis

File Information
Description

Scope:

Given a number of samples, each one represented by a point in the R^d dimensional space, together with a label associated to each sample, this function returns a d x matrix of size n x d that allows to represent each sample by a point in a R^n dimensional space, so that points of different labels are still distinguishable (classification problem)

The implemented function supports two variations of the Fisher criterion, one based on generalised eigenvalues (ratio trace criterion) and another based on an iterative solution of a standard eigenvalue problem (trace ratio criterion). The later implementation, is based on

Lei-Hong Zhang, Li-zhi Liao and Michael K. Ng, "Fast Algorithms for the generalised foley-sammon discriminant analysis", SIAM Journal on Matrix Analysis and Applications, vol 31, p.1584, 2010

which also provides a good analysis of the criteria.

A further variant allows to orient the subspace found by the trace ratio criterion according to the ration trace criterion.

An optional PCA-like preprocessing is available to increase robustness, when the number of features is larger to the number of samples

Options:

Syntax [ V, eigvalueSum ] = fld( X, L, n, crit, qrf, r, e, M )

Input arguments:
X: the s x d samples matrix (s samples x d features each )
L: the s x 1 labels matrix
n: the dimension the subspace required
Optional arguments:
crit: 1 (ratio trace criterion - default)
2 (trace ratio criterion)
3 (tr criterion for subspace + rt criterion for axis)
qrf: preprocess with qr decomposition, for robustness (default value: false)
r: the regularisation parameter (default value: 0)
e: epsilon value to end iterations for tr criterion (defaut value: 0.001)
M: maximum number of iterations for tr criterion (defaut value: 100)

Output:
V: the optimal fiher ( n x d ) orthonormal matrix
ratio: the sum of generalised eigenvalues or the optimal value of the trace ratio
% eigvals: the eigenvalues of the (B - r * W) matrix

Acknowledgements

This file inspired Direct Lda And Pca+Lda.

MATLAB release MATLAB 7.10 (R2010a)
08 Nov 2012 bufferoverflow

bufferoverflow (view profile)

http://archive.ics.uci.edu/ml/datasets/Gisette I tried on this dataset and it gave a bunch of errors.
[X1,eigenValueSum1]=fld(gisette_data,gisette_label,2)

On train_data from the datset folder.

Error using eigs/checkInputs/LUfactorB (line 1001)
B is singular.
Unable to compute the specified eigenvalues because infinite eigenvalue(s) exist

Error in eigs/checkInputs (line 839)
[LB,UB,ppB,qqB,dgB] = LUfactorB;

Error in eigs (line 94)
[A,Amatrix,isrealprob,issymA,n,B,classAB,k,eigs_sigma,whch, ...

Error in fld>ratio_trace_criterion (line 180)
[V, eigvalue] = eigs( Nmat, Dmat, n, 'LM', OPTS );

Error in fld (line 144)
[V, eigvalueSum ] = ratio_trace_criterion( Nmat, Dmat, n );

Any thoughts?

Comment only