Skip to content

CLI reference

tsdive segment

Segment a window into regimes the samples themselves show.

The usage walkthrough has a section on it.

Usage

usage: tsdive segment [-h] [--window WINDOW] [--penalty PENALTY]
                      [--min-size MIN_SIZE]
                      [--basis {TIME_WEIGHTED,EVENT_WEIGHTED}] [--stepped]
                      [--mode-out FILE] [--overwrite] [--json] [--no-color]
                      parquet

Options

Argument Value Default Description
parquet required single-tag parquet archive to segment
--window WINDOW ISO 8601 START/END in UTC; omitted, the whole archive extent
--penalty PENALTY cost one more breakpoint has to buy; omitted, 3*log(n) on the scaled series
--min-size MIN_SIZE 10 samples a segment must hold, at least
--basis {TIME_WEIGHTED,EVENT_WEIGHTED} TIME_WEIGHTED calculation basis declared on the read
--stepped stepped interpolation between samples
--mode-out FILE write the segments as a MODE archive, one label per sample, for screen --mode
--overwrite replace an existing archive at --mode-out
--json print one JSON object and nothing else
--no-color plain text, no ANSI colour (NO_COLOR does the same)

Example

$ tsdive segment data/demo/fic101_demo.parquet
demo:FIC101.PV  6 segments   5 breakpoints   censored yes

window    2024-03-30 20:00:00Z -> 2024-03-31 06:00:00Z   usable 561
method    PELT L2 on MAD-scaled values   penalty 18.99 (3*log n)   min-size 10

  #  start                 end                     n   median     mad
  1  2024-03-30 20:00:00Z  2024-03-30 21:55:00Z  116    62.54  0.1911
  2  2024-03-30 21:56:00Z  2024-03-31 00:09:00Z   95    61.66  0.2427
  3  2024-03-31 00:10:00Z  2024-03-31 02:00:00Z  111    62.56  0.1826
  4  2024-03-31 02:01:00Z  2024-03-31 02:29:00Z   29    100.0       0
  5  2024-03-31 02:30:00Z  2024-03-31 03:56:00Z   86    61.37  0.1696
  6  2024-03-31 03:57:00Z  2024-03-31 06:00:00Z  124    62.52  0.2387