MATLAB File Help: cv.LDA Index
cv.LDA

Linear Discriminant Analysis

Example

Xtrain = randn(100,5);
labels = randi([1 3], [100 1]);
Xtest = randn(100,5);

lda = cv.LDA('NumComponents',3);
lda.compute(Xtrain, labels);
Y = lda.project(Xtest);
Xapprox = lda.reconstruct(Y);
See also
Class Details
Superclasses handle
Sealed false
Construct on load false
Constructor Summary
LDA Constructor, initializes a LDA object. 
Property Summary
eigenvalues of this LDA. Vector of length `ncomponents`. 
eigenvectors of this LDA. Matrix of size `d-by-ncomponents`. 
id Object ID 
Method Summary
  addlistener Add listener for event. 
  compute Compute the discriminants for data and labels. 
  delete Destructor 
  eq == (EQ) Test handle equality. 
  findobj Find objects matching specified conditions. 
  findprop Find property of MATLAB handle object. 
  ge >= (GE) Greater than or equal relation for handles. 
  gt > (GT) Greater than relation for handles. 
Sealed   isvalid Test handle validity. 
  le <= (LE) Less than or equal relation for handles. 
  load Deserializes this object from a given filename. 
  lt < (LT) Less than relation for handles. 
  ne ~= (NE) Not equal relation for handles. 
  notify Notify listeners of event. 
  project Projects samples into the LDA subspace. 
  reconstruct Reconstructs projections from the LDA subspace. 
  save Serializes this object to a given filename.