Linear Discriminant Analysis#

Linear Discriminant Analysis (LDA) is a supervised dimensionality reduction technique that selects the most informative features based on their class labels. More formally, LDA finds a linear combination of features that characterizes or best discriminates two or more classes.

Interfaces: Transformer, Stateful

Data Type Compatibility: Continuous only


# Param Default Type Description
1 dimensions int The target number of dimensions to project onto.

Additional Methods#

Return the amount of variance that has been preserved by the transformation:

public explainedVar() : ?float

Return the amount of variance lost by discarding the noise components:

public noiseVar() : ?float

Return the percentage of information lost due to the transformation:

public lossiness() : ?float


use Rubix\ML\Transformers\LinearDiscriminantAnalysis;

$transformer = new LinearDiscriminantAnalysis(20);