public class Discriminant_Analysis
extends java.lang.Object
The Linear Discriminant analysis is a regression-type technique introduced by Fisher, R. A. (1936) based on averages and can be run when a set of predictors is given as well as a target variable. This version of the algorithm accepts only A binary target (2 distinct values) , however LDA can be used to classify more distinct values.
More specifically LDA Fisher-LDA considers maximizing the following objective:
L(w)=(wTSBw)/(wTSww) Where SB is the between classes scatter matrix or SB=Óc(xc-ì)(xc-ì)T and Sw the within classes scatter matrix or SB=ÓcÓi(ìi-xc)(ìi-xc)T (Max Welling,Toronto,nd)
You may always find more in wikipedia which is always a great source for statistical algorithms at Linear_discriminant_analysis
| Modifier and Type | Field and Description |
|---|---|
double[] |
Betas |
double[] |
predicted_values |
| Constructor and Description |
|---|
Discriminant_Analysis() |
| Modifier and Type | Method and Description |
|---|---|
void |
discriminate(double[] Target,
double[][] covariate)
This is the main method of this class that will populate all the important fields in LDA and compute the coefficients.
|
double[] |
getbetas() |
double[] |
getpredicted_values() |
double[] |
Score_Set(double[][] set)
This method will score a newly given set [rows][columns] based on the betas
that were computed before.
|
public void discriminate(double[] Target,
double[][] covariate)
This is the main method of this class that will populate all the important fields in LDA and compute the coefficients.
Target - : A double array with exactly 2 different values.covariate - : a two dimensional Array ([rows][columns]) with double values to serve as the predictors' set.public double[] getbetas()
public double[] getpredicted_values()
public double[] Score_Set(double[][] set)