#linear-time #detection #changepoint #pruned

nightly bin+lib pelt

Changepoint detection with Pruned Exact Linear Time

1 unstable release

0.1.0 Feb 1, 2020

#12 in #linear-time


249 lines

Changepoint detection with Pruned Exact Linear Time

Changepoint detection using the PELT algorithm. This project is a port of the ruptures Python project. The PELT algorithm is described in this paper.


extern crate pelt;
use std::fs;
use pelt::{MutEstimator, Pelt};

fn main() {
   let s = fs::read_to_string("./pelt-rs/signal.txt").unwrap();
   let signal: Vec<Vec<f64>> = vec!(s.split("\n")
   .map(|a| a.parse()

   let jump = Some(5);
   let min_size = Some(2);
   let loss = Some("l1");
   let pen = 3.;

   let mut m = Pelt::new(jump, min_size, loss, pen);
   println!("{:?}", m.predict(&signal))


A nightly release is required for this crate.


This crate panics when the given signal length is smaller than the min_size field given to alg::Pelt.