elbow_helper.multi_criteria module

Phase M2: the subtractive-sign modified BIC for elbow_helper.robust_knees().

Ported from the validated research/multiknee/criteria.py (see ELBOW-en.tex section 14 and research/multiknee/RESULTS.md for the derivation, the sign-convention ambiguity, and why the subtractive form is the one shipped: 0.85 overall exact-k accuracy and a 0% false-positive rate on flat data, versus 0.77 and 11% for the literal additive form).

Author

Warith Harchaoui, <warith.harchaoui@deraison.ai>

elbow_helper.multi_criteria.modified_bic(seg)[source]

Zhang-Siegmund-inspired modified BIC, subtractive sign convention.

mBIC = n*ln(sse/n) + 3*m*ln(n) - sum(ln(l_j / n)), m = k the number of breakpoints and l_j the segment lengths. Lower is better. See ELBOW-en.tex section 18 for the derivation and why the segment-length term is subtracted rather than added.

Parameters:

seg (Segmentation) – A candidate segmentation, carrying n, sse, k and segment_lengths.

Returns:

The subtractive-sign modified BIC score; lower is better.

Return type:

float