mvtsa.segmentation.MergeTree#
- class mvtsa.segmentation.MergeTree(initial, removed, criterion, total_cost, n_samples, meta=<factory>)[source]#
Bases:
objectHierarchy of segmentations produced by bottom-up merging.
- Attributes:
- initial
arrayofint Change points of the initial (finest) segmentation.
- removed
arrayofint Change point removed by every merge step, in merge order.
- criterion
arrayoffloat Merge criterion (cost increase) of every step.
- total_cost
arrayoffloat total_cost[k]is the total cost afterkmerges (total_cost[0]is the cost of the initial segmentation).- n_samples
int
- initial
- persistence(normalize=True, scale='cost')[source]#
Lifetime of every initial change point in the merge hierarchy.
With
scale="cost"(default) a boundary is born at level 0 and dies at the merge cost at which it is removed – the running maximum of the merge criterion, so that the levels form a filtration as in topological persistence. Withscale="rank"the lifetime is the number of merges it survives. Boundaries that survive to the coarsest level get the maximum value;normalizedivides by that maximum. Large values mark stable, important change points.