Git Product home page Git Product logo

yurita's Introduction

logo

Yurita

Join the chat at https://gitter.im/pp-yurita Build Status Codacy Badge License Documentation Status

Yurita is an open source project for developing large scale anomaly detection models Site

Getting Started

Documentation

Documentation on Yurita's architecture, statistical models available, anomaly detection pipeline/data flow, etc can be found here: https://yurita.readthedocs.io/en/latest/

Build from source

foo@bar:~/yurita$ ./gradlew clean build
foo@bar:~/yurita$ ./gradlew publishToMavenLocal

Install from Maven Central

Please build the project from source at this time or try our dockerized Yurita demo application to build automatically as we make the project jar available on Maven Central in upcoming few days.

<dependency>
    <groupId>io.github.paypal</groupId>
    <artifactId>yurita</artifactId>
    <version>1.0.0</version>
</dependency>

Other Required Dependencies:

<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-core_2.11</artifactId>
    <version>2.4.1</version>
</dependency>
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-sql_2.11</artifactId>
    <version>2.4.1</version>
</dependency>

Running Dockerized Demo Application

YuritaSampleApp directory in the Yurita project root path contains a standalone scala project for you to play around with. Run the demo through Docker inside YuritaSampleApp directory as shown below.

Build Docker Image

foo@bar:~/YuritaSampleApp$ docker build -f Dockerfile -t yuritademo .

Run Docker Container

foo@bar:~/YuritaSampleApp$ docker run -p 8080:8080 -t yuritademo

Writing Your First App

Create SparkSession with your own configurations

val appName = "AnomalyDetectionAPI"
val sparkConf = new SparkConf().setAppName(appName).setMaster("local[*]")
val spark = SparkSession
    .builder()
    .config(sparkConf)
    .getOrCreate()

Create dataframe of your data points/attributes with what time interval they occur on

//sample window timestamp
val window1 = (dateFormat.parse("2011-01-18 01:00:00.0"), dateFormat.parse("2011-01-18 01:00:10.0"))
val inputDF: DataFrame = Seq(
    Person("Ned", "Stark", 40, 40.6, "M", Array(5.5), getTimestamp(window1)),
    Person("Arya", "Stark", 9, 40.1, "F", Array(5.6), getTimestamp(window2)),
    Person("Sansa", "Stark", 13, 46.3, "F", Array(5.6), getTimestamp(window3)),
    Person("Jon Snow", "Stark", 17, 11.4, "M", Array(12.4), getTimestamp(window1),
    ...
).toDF()

Create a data pipe that will perform specified stastical methods on set columns of dataframe within the window size.

val categoricalPipe = PipelineBuilder()
    .onColumns(Seq("surname", "gender"))
    .setWindowing(Window.fixed("1 hour"))
    .setWindowReferencing(windowRef)
    .buildCategoricalModel(
    Functions.Categorical.avgRef,
    Functions.Categorical.entropy,
    Functions.statResultThreshold(3.0))

Combine multiple pipelines

val workload = AnomalyWorkload.builder()
    .addAllPipelines(categoricalPipe)
    .addPartitioner("surname")
    .buildWithWatermark("timestamp", "2 hours")

Dataset extended api

df.detectAnomalies(workload).map(_.toString).foreach(println(_))

Full demo application code can be viewed in our YuritaSampleApp project.

Contributing to Yurita

Thank you very much for contributing to Yurita. Please read the contribution guidelines for the process.

License

Yurita is licensed under the Apache License, v2.0

yurita's People

Contributors

endeavors avatar r39132 avatar urisilberstein avatar guygerson avatar supertej avatar glamdring avatar

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.