mvtsa.segmentation.BottomUp#

class mvtsa.segmentation.BottomUp(cost='l2', n_segments=None, penalty=None, max_cost=None, min_size=None, initial_size=None, merge_criterion='increase', cost_params=None)[source]#

Bases: BaseSegmenter

Bottom-up segmentation by greedy merging of adjacent segments.

The series is first cut into segments of initial_size samples; the pair of neighbours whose merging increases the total cost least is merged repeatedly. A heap with lazy invalidation makes a run \(O(T/s\,\log(T/s))\) cost evaluations.

Parameters:
coststr or cost object

Cost function (see mvtsa.segmentation.costs).

n_segmentsint, optional

Stop at this number of segments.

penaltyfloat, optional

Stop when the smallest cost increase exceeds penalty.

max_costfloat, optional

Stop when the total cost would exceed max_cost.

min_sizeint, optional

Minimal segment length (default: the cost’s own minimum).

initial_sizeint, optional

Length of the initial segments (default min_size).

merge_criterion{“increase”, “merged”}

"increase": \(cost(S_l\cup S_r)-cost(S_l)-cost(S_r)\); "merged": \(cost(S_l\cup S_r)\) as in Algorithm 2.1 of Bankó (2015).

cost_paramsdict, optional

Keyword arguments for a cost given by name.

Attributes:
tree_MergeTree

The complete merge hierarchy (run until one segment remains when no stopping rule is given).

full_tree(X)[source]#

Run the merging down to one segment and return the hierarchy.

Examples using mvtsa.segmentation.BottomUp#

Costs and search strategies

Costs and search strategies

The merge hierarchy: segmentogram and persistence

The merge hierarchy: segmentogram and persistence

Operating ranges of an energy indicator

Operating ranges of an energy indicator

Consensus of segmentations

Consensus of segmentations

Clustering segments: recurring patterns across series

Clustering segments: recurring patterns across series

Is the segmentation stable?

Is the segmentation stable?

Benchmarking segmenters with statistical tests

Benchmarking segmenters with statistical tests

A one-page segmentation report

A one-page segmentation report

From analysis to a deployable model

From analysis to a deployable model

Grade transitions of a polymerization reactor

Grade transitions of a polymerization reactor