algorithm-tools / ad4j

Java implemented anomaly detection library.
5 stars 2 forks source link
anomaly-algorithm-library anomaly-detection anomalydetection

AnomalyDetection-Java

License Total Lines CN doc EN doc

Introduction

Java implemented anomaly monitoring algorithm library.

AnomalyDetection Java is an anomaly detection algorithm library based on statistical and machine learning approaches, implemented in Java. It can be easily embedded in actual business to monitor various types of anomalies in data sequences, including outlier anomalies, fluctuation anomalies, trend anomalies, and so on.

Feature

Its main feature are as follows:

Demos

For Developers

Building ad4j

you can build ad4j using Maven by issuing the following command from the root directory of the project:

mvn clean install -Dmaven.test.skip=true

The build requires JDK 8 or later.

Using ad4j

- business use:
  `BizUseExample`
```java
public class BizUseExample {

    public static void main(String[] args) {
        indicatorDetect();
    }

    public static void indicatorDetect(){
        // 1. Transfer biz data to indicator series info
        long currentTime = System.currentTimeMillis();
        List<IndicatorSeries> indicatorSeries = new ArrayList<>();
        indicatorSeries.add(new IndicatorSeries(currentTime + 1, 1d, "logicalIndex-1"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 2, 2d, "logicalIndex-2"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 3, 3d, "logicalIndex-3"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 4, 4d, "logicalIndex-4"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 5, 40d, "logicalIndex-5"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 6, 6d, "logicalIndex-6"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 7, 7d, "logicalIndex-7"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 8, 8d, "logicalIndex-8"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 9, 9d, "logicalIndex-9"));
        indicatorSeries.add(new IndicatorSeries(currentTime + 10, 10d, "logicalIndex-10"));

        IndicatorInfo info = new IndicatorInfo("Example", "Example-Name", indicatorSeries);

        // 2. New AnomalyDetectionEngine to detect
        AnomalyDetectionEngine engine = new AnomalyDetectionEngine();
        AnomalyDetectionResult detectionResult = engine.detect(info);

        // 3. Business process detect result. Like Records,Alarms,Print
        IndicatorSeriesUtil.print(detectionResult);
    }

}

Test case

ADEngineTest.java

Participate in Contributions

PRs Welcome

Welcome to join the community, build a win-win situation, please refer to the contribution process: How to contribute.

Thank you to all the people who already contributed to AnomalyDetection-Java!

Contributors

Get Help