mvtsa.segmentation.NeighborMergeSegmenter#

class mvtsa.segmentation.NeighborMergeSegmenter(dissimilarity, n_segments=None, threshold=None, initial_size=20, name='NeighborMerge')[source]#

Bases: BaseSegmenter

Bottom-up merging of adjacent segments by a pairwise dissimilarity.

Parameters:
dissimilaritycallable()

dissimilarity(X, (a, b), (b, c)) -> float: how different the adjacent segments X[a:b] and X[b:c] are (0 = identical).

n_segmentsint, optional

Stop at this number of segments.

thresholdfloat, optional

Stop when the smallest dissimilarity exceeds threshold.

initial_sizeint

Length of the initial segments.

namestr

Name stored in the result.

Attributes:
tree_MergeTree

Merge hierarchy; criterion holds the dissimilarity of each merge and total_cost its running sum.