prtPreProcLda Linear discriminant analysis processing
preProc = prtPreProcLda creates a linear discriminant pre
processing object. A prtPreProcLda object projects the input data
onto a linear space that best separates class labels
A prtPreProcLda object has the following properties:
nComponents - The number of dimensions to project the data onto.
This must less than or equal to the input data's
number of features, and less than or equal to the
input data sets number of classes.
A prtPreProcLda object also inherits all properties and functions from
the prtAction class
More information about LDA can be found at the following URL:
http://en.wikipedia.org/wiki/Linear_discriminant_analysis
Example:
dataSet = prtDataGenIris; % Load a dataset
dataSet = dataSet.retainFeatures(1:3); % Retain the first 3 features
lda = prtPreProcLda; % Create the pre-processor
lda = lda.train(dataSet); % Train
dataSetNew = lda.run(dataSet); % Run
% Plot the results
subplot(2,1,1); plot(dataSet);
title('Original Data');
subplot(2,1,2); plot(dataSetNew);
title('LDA Projected Data');