Code Monkey home page Code Monkey logo

midas-1's Introduction

MIDAS

MIDAS - edge stream anomaly detection - for Ruby

Build Status

Installation

Add these lines to your application’s Gemfile:

gem 'midas-edge'
gem 'rice', github: 'jasonroelofs/rice' # for now for c++17

Getting Started

Prep your data in the format [source, destination, time] (all integers) and sorted by time (ascending)

data = [
  [2, 3, 1],
  [3, 4, 2],
  [5, 9, 2],
  [2, 3, 3]
]

Get anomaly scores

midas = Midas.new
scores = midas.fit_predict(data)

Higher scores are more anomalous. There is not currently a defined threshold for anomalies.

Parameters

Pass parameters - default values below

Midas.new(
  rows: 2,           # number of hash functions
  buckets: 769,      # number of buckets
  alpha: 0.5,        # temporal decay factor
  threshold: nil,    # todo
  relations: true,   # whether to use MIDAS-R or MIDAS
  directed: true,    # treat the graph as directed or undirected
  seed: 0            # random seed
)

Data

Data can be an array of arrays

[[1, 2, 3], [4, 5, 6]]

Or a Numo array

Numo::NArray.cast([[1, 2, 3], [4, 5, 6]])

Performance

For large datasets, read data directly from files

midas.fit_predict("data.csv")

Resources

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone --recursive https://github.com/ankane/midas.git
cd midas
bundle install
bundle exec rake compile
bundle exec rake test

midas-1's People

Contributors

ankane avatar

Watchers

 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.