Skip to content
Edge stream anomaly detection for Ruby
Ruby C++
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ext/midas Removed unneeded check [skip ci] Feb 18, 2020
lib Version bump to 0.1.1 [skip ci] Feb 19, 2020
test First commit Feb 18, 2020
vendor First commit Feb 18, 2020
.gitignore First commit Feb 18, 2020
.gitmodules First commit Feb 18, 2020
.travis.yml Added Travis Feb 18, 2020
CHANGELOG.md Version bump to 0.1.1 [skip ci] Feb 19, 2020
Gemfile First commit Feb 18, 2020
LICENSE.txt First commit Feb 18, 2020
NOTICE.txt First commit Feb 18, 2020
README.md Updated dev instructions [skip ci] Feb 18, 2020
Rakefile First commit Feb 18, 2020
midas-edge.gemspec First commit Feb 18, 2020

README.md

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.6,        # temporal decay factor
  relations: true,   # whether to use MIDAS-R or MIDAS
  directed: true     # treat the graph as directed or undirected
)

Data

Data can be an array of arrays

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

Or a Numo NArray

Numo::Int32.new(3, 2).seq

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
You can’t perform that action at this time.