breakout

Crates.iobreakout
lib.rsbreakout
version0.3.0
sourcesrc
created_at2021-09-12 21:34:22.428196
updated_at2024-07-11 05:20:44.841793
descriptionBreakout detection for Rust
homepage
repositoryhttps://github.com/ankane/breakout-rust
max_upload_size
id450213
size56,681
Andrew Kane (ankane)

documentation

README

Breakout Rust

🔥 BreakoutDetection for Rust

Learn how it works

🎉 Zero dependencies

Build Status

Installation

Add this line to your application’s Cargo.toml under [dependencies]:

breakout = "0.3"

Getting Started

Detect breakouts in a series

let series = vec![
    3.0, 1.0, 2.0, 3.0, 2.0, 1.0, 1.0, 2.0, 2.0, 3.0,
    6.0, 4.0, 4.0, 5.0, 6.0, 4.0, 4.0, 4.0, 6.0, 5.0,
    9.0, 8.0, 7.0, 9.0, 8.0, 9.0, 9.0, 9.0, 7.0, 9.0
];
let breakouts = breakout::multi().min_size(5).fit(&series).unwrap();

Detect a single breakout (at most one change)

let breakout = breakout::amoc().min_size(5).fit(&series).unwrap();

Options

Multi

breakout::multi()
    .min_size(30)      // minimum observations between breakouts
    .degree(2)         // degree of the penalization polynomial
    .beta(0.008)       // penalization term
    .percent(None)     // minimum percent change in goodness of fit statistic

Single

breakout::amoc()
    .min_size(30)      // minimum observations between breakouts
    .alpha(2.0)        // weight of the distance between observations
    .exact(false)      // exact or approximate median

Credits

This library was ported 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-rust.git
cd breakout-rust
cargo test
Commit count: 38

cargo fmt