Giter Site home page Giter Site logo

anomalydetection's Introduction

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);

对机器学习,人工智能感兴趣的小伙伴可以加我微信:JeemyJohn,我拉你进我的机器学习群(群里很多高手哦!),或者扫描二维码!当然你也可以关注我的公众号,点击链接:燕哥带你学算法公众号团队简介

这里写图片描述

anomalydetection's People

Contributors

jeemyjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anomalydetection's Issues

Possible incorrect subtree height when max height reached

} else if (curHeight >= limitHeight || samples.length == 1) {

I didn't try it, but does the scoring behave correctly, later on? I'm not sure if it is correct when you reached the maximum height and set the subtree height of this leaf on 1 instead of the samples length.

If you ever experienced any odd behavior in your scorings, I suggest that you try to change that and see what's happening.

code review

你这个代码有好多问题,我随便列几个

  1. .idea文件等代码、配置无关的文件不要checkin;
  2. package的层次还不够好;
  3. I**的方式一般是用来定义接口的,而不是class;定义接口是个好习惯,应该另行起class实现接口;
  4. 测试一般不要写在某个class的main函数里,用junit

Categorical and continious data

Hi and thanks for your work !

I have categorical data (that I encoded in one hot vector) and continuous data as well for each data.
The original paper doesn't mention the handling of categorical data.

Does your repo handle it ?

Thanks in advance,

Anomaly Value

Hello,
When I read the research paper which were mentioned. It was stated the score closer to 1 is an anomaly, However when I ran the code it was opposite.

Am I doing anything wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.