Breakout detection for Ruby

Overview

Breakout

🔥 BreakoutDetection for Ruby

Learn how it works

Build Status

Installation

Add this line to your application’s Gemfile:

gem 'breakout-detection'

Getting Started

Detect breakouts in a time series

series = {
  Date.parse("2020-01-01") => 100,
  Date.parse("2020-01-02") => 150,
  Date.parse("2020-01-03") => 136,
  # ...
}

Breakout.detect(series)

Works great with Groupdate

series = User.group_by_day(:created_at).count
Breakout.detect(series)

Series can also be an array without times (the index is returned)

series = [100, 150, 136, ...]
Breakout.detect(series)

Options

Pass options - default values below

Breakout.detect(
  series,
  min_size: 30,        # minimum observations between breakouts
  method: "multi",     # multi or amoc (at most one change)
  degree: 1,           # degree of the penalization polynomial (multi only)
  beta: 0.008,         # penalization term (multi only)
  percent: nil,        # minimum percent change in goodness of fit statistic (multi only)
  alpha: 2,            # weight of the distance between observations (amoc only)
  exact: true          # exact or approximate median (amoc only)
)

Credits

This library uses the C++ code from the BreakoutDetection R package and is available under the same license.

References

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 https://github.com/ankane/breakout.git
cd breakout
bundle install
bundle exec rake compile
bundle exec rake test
You might also like...
Semantic Edge Detection with Diverse Deep Supervision

Semantic Edge Detection with Diverse Deep Supervision This repository contains the code for our IJCV paper: "Semantic Edge Detection with Diverse Deep

WIP / DIN-rail compatible WiFi security camera with additional features (doorbell detection, magnetic / reed switch door & PIR sensor...) that sends you alerts on Telegram if someone unauthorised breaks into your house.
WIP / DIN-rail compatible WiFi security camera with additional features (doorbell detection, magnetic / reed switch door & PIR sensor...) that sends you alerts on Telegram if someone unauthorised breaks into your house.

WIP / DIN-rail compatible WiFi security camera with additional features (doorbell detection, magnetic / reed switch door & PIR sensor...) that sends you alerts on Telegram if someone unauthorised breaks into your house.

Real Time, High performance BOT detection and protection
Real Time, High performance BOT detection and protection

REAL-TIME BOT PROTECTION CHALLENGE IronFox https://innovera.ir IronFox is a real-time and high performance bot protection, that using Nginx as a reve

Evasive shellcode loader for bypassing event-based injection detection (PoC)
Evasive shellcode loader for bypassing event-based injection detection (PoC)

DripLoader (PoC) Evasive shellcode loader for bypassing event-based injection detection, without necessarily suppressing event collection. The project

Ios-malicious-bithunter - iOS Malicious Bit Hunter is a malicious plug-in detection engine for iOS applications. It can analyze the head of the macho file of the injected dylib dynamic library based on runtime. If you are interested in other programs of the author, please visit https://github.com/SecurityLife TiEtwAgent - PoC memory injection detection agent based on ETW, for offensive and defensive research purposes
TiEtwAgent - PoC memory injection detection agent based on ETW, for offensive and defensive research purposes

TiEtwAgent - ETW-based process injection detection This project was created to research, build and test different memory injection detection use cases

On-device wake word detection powered by deep learning.
On-device wake word detection powered by deep learning.

Porcupine Made in Vancouver, Canada by Picovoice Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening

TAFuzzer: Effective and Efficient Targeted Fuzzing framework for Smart Contract Vulnerability Detection (CCS2022a Under Review).

TAFuzzer An effective and efficient targeted fuzzing framework for smart contract vulnerability detection. Requirements TAFuzzer is supported on Linux

 Accident Detection Prevention and an Emergency Solution (ADPES)
Accident Detection Prevention and an Emergency Solution (ADPES)

Arduino Code for integration of GSM module, GPS module, and various sensor to implement Accident Detection Prevention and an Emergency Solution (ADPES).

Comments
  • How does this work?

    How does this work?

    Hi, thanks for releasing this! I didn't see a discussions tab, so I'm posting my question here.

    I have a series with 2,590 entries. It consists of a UTC time and an integer value. Something like this:

    require 'time'
    require 'breakout-detection'
    
    series = {
      Time.parse('2021-09-22T11:58:37Z') => 301590765,
      Time.parse('2021-09-22T12:05:15Z') => 9421127680,
      Time.parse('2021-09-22T12:25:32Z') => 301590765,
      # ...
    }
    
    results = Breakout.detect(series)
    # results=[]
    

    Most of the values are in the range of 300,000,000, however, one value is 9,421,127,680. Should the breakout detect the 9 million value? Currently, it's returning an empty array.

    Am I doing something wrong? Should I change a default setting?

    Thanks!

    opened by ejstembler 3
Owner
Andrew Kane
Andrew Kane
Calleree helps to analyze Ruby's caller-callee relationships.

Calleree Calleree helps to analyze Ruby's caller-callee relationships. Note that this tool consumes memory and introduces additional overhead because

Koichi Sasada 18 Sep 23, 2021
Seasonal-trend decomposition for Ruby

STL Ruby Seasonal-trend decomposition for Ruby Installation Add this line to your application’s Gemfile: gem 'stl-rb' Getting Started Decompose a time

Andrew Kane 15 Mar 14, 2022
List of Persian Colors and hex colors for CSS, SCSS, PHP, JS, Python, and Ruby.

Persian Colors (Iranian colors) List of Persian Colors and hex colors for CSS, SCSS, PHP, C++, QML, JS, Python, Ruby and CSharp. Persian colors Name H

Max Base 12 Sep 3, 2022
Examples of C extensions in Ruby gems

Ruby C Extensions, Explained Background How To Use This Repository Strategies Strategy 0, "isolated" Strategy 1, "system" Strategy 2a, "packaged_sourc

Mike Dalessio 58 Oct 2, 2022
Access USB devices from Ruby via libusb-1.x

Access USB devices from Ruby LIBUSB is a Ruby binding that gives Ruby programmers access to arbitrary USB devices. libusb is a library that gives full

Lars Kanis 149 Aug 4, 2022
a small C library for x86 CPU detection and feature extraction

libcpuid libcpuid provides CPU identification for the x86 (and x86_64). For details about the programming API, you might want to take a look at the pr

Veselin Georgiev 340 Sep 26, 2022
Evasive shellcode loader for bypassing event-based injection detection (PoC)

(cleaned up version here: https://github.com/xinbailu/DripLoader-Ops) DripLoader (PoC) Evasive shellcode loader for bypassing event-based injection de

Filip Olszak 530 Sep 23, 2022
FireDog - Open source cross-platform lightweight virus signature detection engine.

FireDog 开源跨平台轻量级病毒特征检测引擎。Open source cross-platform lightweight virus signature detection engine. 语言 Language C++ 11 LICENSE 是你们喜欢的:MIT License. 让我们搞起

null 40 Aug 20, 2022
Patches/unpatches an MCC CEA map to use client side hit detection for all weapons

MCC CEA Client-Side Hit Detection Map Patcher This program allows you to patch an MCC map so that all maps use client-side hit detection instead of ju

Snowy 5 Aug 30, 2022
Self driving car with obstacle detection and avoidance

STM32F4-Self-Driving-Car-Mini-Project Self driving car with obstacle detection and avoidance Hardware STM32F401RE Dev Board HCSR04 ultrasonic sensor (

Olaoluwa Raji 2 Jan 6, 2022