Skip to content

XJS924/AnomalyDetection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnomalyDetection

This Project aim of implements most of Anomaly Detection Algorithms in Java. If you want to contribute source code, please write Email to [email protected], or you can add my WeChat Number: JeemyJohn

1. Isolation Forest

This algorithm is realized in package iforest.
Algorithm Home Page: http://blog.csdn.net/u013709270/article/details/73436588

Source Paper:
             http://cs.nju.edu.cn/zhouzh/zhouzh.files/publication/icdm08b.pdf
             http://cs.nju.edu.cn/zhouzh/zhouzh.files/publication/tkdd11.pdf

Usage step:

  1. Create an object of class IForest
      IForest iForest = new IForest();
  1. Get samples and train
      double[][] samples = new double[1000][2];
      
      //get samples
      ...
      
      int[] ans = iForest.train(samples, 100);

     We have two declaration of function train, the implementation of them are same to each other. The only difference of them is one have default parameter. As the results of function train ans, if ans[i]==0 means it's an Anomaly(or Isolation) Point, else a Normal Point.

  1. Predict a new sample

     If a sample does not in samples, we can use function predict to judge it a Normal point or not.

     double[] sample = ...
     int label = iForest.predict(sample);
     System.out.println(label);

About

Anomaly Detection Algorithms with Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%