Number of watchers on Github  65 
Number of open issues  1 
Average time to close an issue  3 months 
Main language  R 
Average time to merge a PR  about 1 hour 
Open pull requests  0+ 
Closed pull requests  1+ 
Last commit  over 2 years ago 
Repo Created  almost 4 years ago 
Repo Last Updated  over 1 year ago 
Size  79 KB 
Organization / Author  terrytangyuan 
Latest Release  1.1.2 
Contributors  2 
Page Updated  20180315 
Do you use lfda? Leave a review!  
View lfda activity  
View on github  
Fresh, new opensource launches 🚀🚀🚀  
Trendy new open source projects in your inbox!
View examples

R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semisupervised Local Fisher Discriminant Analysis.
Introduction to the algorithms and their application can be found here and here. These methods are widely applied in feature extraction, dimensionality reduction, clustering, classification, information retrieval, and computer vision problems.
Welcome any feedback and pull request.
install.packages('lfda')
devtools::install_github('terrytangyuan/lfda')
Please call citation("lfda")
in R to properly cite this software. A white paper is available here.
Suppose we want to reduce the dimensionality of the original data set (we are using iris
data set here) to 3, then we can run the following:
k < iris[,5] # this matrix contains all the predictors to be transformed
y < iris[,5] # this should be a vector that represents different classes
r < 3 # dimensionality of the resulting matrix
# run the model, note that two other kinds metrics we can use: 'weighted' and 'orthonormalized'
model < lfda(k, y, r, metric = "plain")
plot(model, y) # 3D visualization of the resulting transformed data set
predict(model, iris[,5]) # transform new data set using predict
The main usage is the same except for an additional kmatrixGauss
call to the original data set to perform a kernel trick:
k < kmatrixGauss(iris[,5])
y < iris[,5]
r < 3
model < klfda(k, y, r, metric = "plain")
Note that the predict
method for klfda is still under development. The plot
method works the same way as in lfda
.
This algorithm requires one additional argument such as beta
that represents the degree of semisupervisedness. Let's assume we ignore 10% of the labels in iris
data set:
k < iris[,5]
y < iris[,5]
r < 3
model < self(k, y, beta = 0.1, r = 3, metric = "plain")
The methods predict
and plot
work the same way as in lfda
.
{ggplot2::autoplot}
has been integrated with this package. Now {lfda}
can be plotted in 2D easily and beautifully using {ggfortify}
package. Go to this link and scroll down to the last section for an example.
Fisher(Local Fisher Discriminant Analysis)Metric Learning(transformation matrix)(class)(betweenclass distance)(withinclass distance)(multimodality)lfda(local structure)lfda
Fisher(Kernel Local Fisher Discriminant Analysis)Fisherkernel trickFisher
Fisher(Semisupervised Local Fisher Discriminant Analysis)Fisher(Principal Component Analysis)Fisherclass label
lfda
install.packages('lfda')
devtools::install_github('terrytangyuan/lfda')
3
k < iris[,5] #(predictors)
y < iris[,5] # (class labels)
r < 3 #
# `lfda``metric`'plain', 'weighted', 'orthonormalized'
model < lfda(k, y, r, metric = "plain")
plot(model, y) #
predict(model, iris[,5]) # predictlfda
klfda
lfda
lfdakmatrixGauss
:
k < kmatrixGauss(iris[,5])
y < iris[,5]
r < 3
model < klfda(k, y, r, metric = "plain")
klfdapredict
plot
lfda
beta
beta=0 beta=0 iris
10%
k < iris[,5]
y < iris[,5]
r < 3
model < self(k, y, beta = 0.1, r = 3, metric = "plain")
predict
plot
lfda
terrytangyuan@gmail.comPull Request
R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semisupervised Local Fisher Discriminant Analysis.
See NEWS for details of changes.
R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semisupervised Local Fisher Discriminant Analysis.
See NEWS.md for details of changes.
R package for performing and visualizing Local Fisher Discriminant Analysis, Kernel Local Fisher Discriminant Analysis, and Semisupervised Local Fisher Discriminant Analysis.