LDA

Steps

  • Compute the dd-dimensional mean vectors for the different classes from the dataset.
  • Compute the scatter matrices (in-between-class and within-class scatter matrix).
  • Compute the eigenvectors and corresponding eigenvalues for the scatter matrices.
  • Sort the eigenvectors by decreasing eigenvalues and choose  eigenvectors with the largest eigenvalues to form a  dimensional matrix  (where every column represents an Eigenvector).
  • Use this  Eigenvector matrix to transform the samples onto the new subspace. This can be summarized by the matrix multiplication:  (where  is a -dimensional matrix representing the  samples, and  are the transformed -dimensional samples in the new subspace).