Penalty Learning

Implementations of algorithms from Learning Sparse Penalties for Change-point Detection using Max Margin Interval Regression, by Hocking, Rigaill, Vert, Bach <> published in proceedings of ICML2013.



tests/support for flsa and HMM?

  • option to not stop in labelError if there is the same number of changes in two models.


use future.apply::future_lapply.


remove vignette to pass CRAN check.


In vignette, remove cghseg since it has memory problems, use Segmentor instead, with trivial 1 segment model when Segmentor fails.

Remove cghseg from example(modelSelectionC).

Don't use fullpage in vignette because that causes a NOTE on CRAN mac.


try to fix vignette by using cghseg:::segmeanCO instead of Segmentor.


there is some problem with Segmentor3IsBack on windows, which crashes our vignette re-building in CRAN checks on solaris... not sure why but try to fix via adding tryCatch in vignette.

Add ... passed from IntervalRegressionCV to IntervalRegressionRegularized.


labelError bugfix and test case for no predicted changes.

Simplify examples -- avoid running Segmentor since this crashes on new versions of R on windows.


IntervalRegressionCV uses future instead of foreach.


corrections encountered while preparing tutorial,

  • theme_no_space() evaluated at runtime rather than theme_no_space which was evaluated at build time.

  • stop with an error if there are models that have the same number of changes -- this prevents problems for changepoint models, but prevents using the code with L1 regularized models (fused lasso).

  • stop with an error in targetIntervals if the errors column is not numeric. And return an errors column (the minimum number of incorrect labels).


prepare for CRAN submission:

  • convert to src/*.cpp files and register routines.
  • NULL variables to avoid CRAN checks about global variables.
  • vignette.
  • many more user-friendly error messages.
  • coefficients of IntervalRegression models are now returned on the original scale.


IntervalRegression S3 class with plot, print, and predict methods.

largestContinuousMinimum C implementation.

more informative error messages when arguments to R functions are not as expected.

check for bigger/smaller data sets in ROChange and labelError.

check for errors in C code and return with non-zero status.


labelError works when there are more models than labels, and gives an informative error when there are no corresponding models for a given label.


tests for peak model and for IntervalRegression functions.


IntervalRegression* functions.


labelError, targetIntervals, ROChange.


C solver for linear time modelSelection algorithm, interface via modelSelectionC function.

modelSelectionR function with original quadratic time algorithm in R code.

modelSelection which takes a data.frame as input instead of vectors, and uses modelSelectionC.


First version.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2020.5.13 by Toby Dylan Hocking, a year ago

Report a bug at

Browse source code at

Authors: Toby Dylan Hocking

Documentation:   PDF Manual  

GPL-3 license

Imports data.table, ggplot2

Suggests neuroblastoma, jointseg, testthat, future, future.apply, directlabels

Imported by PeakSegJoint, PeakSegOptimal.

Suggested by PeakSegDP.

See at CRAN