I am trying to implement fisher’s linear discriminant function in matlab for K(Class) > 2, I am not really sure the algorithm for the K > 2 scenario. I know Matlab has inbuilt functions but I want to implement this without using them.
It will be great if someone could clear the algorithm.
Here is some sample pseudo code:
N = number of cases
c= number of classes
Priors = vector of prior probabilities for each case per class
Target = Target labels for each case per class
dimension of Data = Features x Cases.
Get target labels for each data point:
Calculate the mean vector per class and the common covariance matrix:
Get discriminant value using class mean vectors and common covariance matrix:
Function will produce c discriminant values. The case is then assigned to the class with the largest discriminant value.