MIDAS - edge stream anomaly detection - for Ruby
Add this line to your application’s Gemfile:
gem"midas-edge"Create a detector
midas=Midas::Detector.newUpdate with an event
score=midas.update(source_id,destination_id,time)IDs should be integers and events should be ordered by time (ascending). Higher scores are more anomalous. There is not currently a defined threshold for anomalies.
Pass parameters - default values below
Midas::Detector.new(rows: 2,# number of hash functionsbuckets: 769,# number of bucketsalpha: 0.5,# temporal decay factorthreshold: nil,# todorelations: true,# whether to use MIDAS-R or MIDASseed: 0# random seed)For large datasets, read data directly from files
midas.batch_update("data.csv")View the changelog
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone --recursive https://github.com/ankane/midas-ruby.git
cd midas-ruby
bundle install
bundle exec rake compile
bundle exec rake test