mvtsa.segmentation.select_n_segments#

mvtsa.segmentation.select_n_segments(X, cost='l2', method='knee', max_segments=20, rr_threshold=0.05, initial_size=None, cost_params=None, **kwargs)[source]#

Choose the number of segments of a cost-based segmentation.

Parameters:
method{“knee”, “rr”, “bic”, “permutation”, “persistence”}

"knee": elbow of the cost curve; "rr": the largest c whose relative reduction still exceeds rr_threshold; "bic": minimal \(T\log(cost/T)+k\,c\log T\) (Gaussian errors); "permutation": permutation_test_segments(); "persistence": the largest gap of the logarithmic persistence (merge-cost lifetime) of the change points of the merge hierarchy.

Returns:
n_segmentsint
infodict

Cost curve, relative reductions and method-specific values.

Examples using mvtsa.segmentation.select_n_segments#

How many segments?

How many segments?