This function implements local Fisher discriminant analysis. It gives the discriminant function with the posterior possibility of each class.
LFDA(x, y, r, prior = proportions,
CV = FALSE, usekernel = TRUE, fL = 0,
tol, kernel = "gaussian",
metric = c("orthonormalized", "plain", "weighted"),
knn = 5, ...)
Input training data
Training labels
Number of reduced features that will be kept
Prior possibility of each class
Whether to do cross validation
Whether to use the kernel discrimination in native bayes classifier
Feed to native bayes classifier. Factor for Laplace correction, default factor is 0, i.e. no correction.
The tolerance used in Mabayes discrimination, see Mabayes
If usekernel is TRUE, specifying the kernel names, see NaiveBaye.
The type of metric in the embedding space (no default), e.g., 'weighted', weighted eigenvectors; 'orthonormalized' , orthonormalized; 'plain', raw eigenvectors.
Number of nearest neighbors
additional arguments for the classifier
The class labels
The posterior possibility of each class
Discrimintion results using the Mabayes classifier
Discrimintion results using the Naive bayes classifier
The reduced features
%% ...
The results give the classified classes and the posterior possibility of each class using different classifier.
Sugiyama, M (2007). Dimensionality reduction of multimodal labeled data by local Fisher discriminant analysis. Journal of Machine Learning Research, vol.8, 1027-1061.
Sugiyama, M (2006). Local Fisher discriminant analysis for supervised dimensionality reduction. In W. W. Cohen and A. Moore (Eds.), Proceedings of 23rd International Conference on Machine Learning (ICML2006), 905-912.
Tang, Y., & Li, W. (2019). lfda: Local Fisher Discriminant Analysis inR. Journal of Open Source Software, 4(39), 1572.
Moore, A. W. (2004). Naive Bayes Classifiers. In School of Computer Science. Carnegie Mellon University.
Pierre Enel (2020). Kernel Fisher Discriminant Analysis (https://www.github.com/p-enel/MatlabKFDA), GitHub. Retrieved March 30, 2020.
# NOT RUN {
LFDAtest=LFDA(iris[,1:4],y=iris[,5],r=3,
CV=FALSE,usekernel = TRUE, fL = 0,
kernel="gaussian",metric = "plain",knn = 6,tol = 1)
LFDApred=predict.LFDA(LFDAtest,iris[1:10,1:4],prior=NULL)
# }
Run the code above in your browser using DataLab