How to use LOF for outlier detection as I have training and test dataset? I want to use the Local Outlier Factor (LOF) algorithm for outlier detection but it simply finds outliers on unlabed data as whole and you do not need to have a training and test set. However in my case I expect to get some knowledge from the training set and test this knowledge on test data (it seems like an ordinary classification problem :) ). Is there any way to use the LOF or any other anomaly detection algorithm via training and test set? At least, how can I get some statistics for my test set specifically? What is the methodology of using these with separated data?
 A: If you have training data, you might want to look at one-class classification methods, such as one-class SVM.
A: You can try this paper [1]. This work is about matching train and test distribution matching and estimation of density ratio $P_{test}(x)/P_{train}(x)$. However, it is designed in such a way that instead of computing the density ratio of train to test, it computes density ratio of train to some convex combination of train and test distribution i.e $\alpha P_{train} + (1 - \alpha)P_{test}$. Now, by setting $\alpha$ close to 1, they are able to do outlier detection and in fact it is one of their experiments in their paper.
Now, this method does not use the training set labels, but just the training set points. As @Anony-Mousse has already pointed above (+1), you can also try out one-class SVMs for the same as well, which can use the labels. 
[1] Relative Density-Ratio Estimation for Robust Distribution Comparison 
Paper: http://arxiv.org/abs/1106.4729 
Matlab code : http://www.kecl.ntt.co.jp/icl/ls/members/myamada/RuLSIF.html
A: The answer is no, LOF is not appropriate for your problem. LOF is an unsupervised outlier detection method. Now, the features you select and the distance metric you pick for your graph naturally determine part of what it means for a point to be further from its neighbors than they are from each other, but at the end of the day, what you need to do is just train a good ol' supervised classifier. Someone suggested SVM, you might also look at boosted trees, random forest, neural nets, logistic regression, etc.
