Performs local fisher discriminant analysis (LFDA) on the given data.
lfda(x, y, r, metric = c("orthonormalized", "plain", "weighted"),
knn = 5)
n x d matrix of original samples. n is the number of samples.
length n vector of class labels
dimensionality of reduced space (default: d)
type of metric in the embedding space (no default) 'weighted' --- weighted eigenvectors 'orthonormalized' --- orthonormalized 'plain' --- raw eigenvectors
parameter used in local scaling method (default: 5)
list of the LFDA results:
d x r transformation matrix (Z = x * T)
n x r matrix of dimensionality reduced samples
LFDA is a method for linear dimensionality reduction that maximizes between-class scatter and minimizes within-class scatter while at the same time maintain the local structure of the data so that multimodal data can be embedded appropriately. Its limitation is that it only looks for linear boundaries between clusters. In this case, a non-linear version called kernel LFDA will be used instead. Three metric types can be used if needed.
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.
See klfda
for the kernelized variant of
LFDA (Kernel LFDA).
# NOT RUN {
k <- iris[, -5]
y <- iris[, 5]
r <- 3
lfda(k, y, r, metric = "plain")
# }
Run the code above in your browser using DataLab