prior2024_bic_gradient_k
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- prior2024_bic_gradient_k(bic_scores: Sequence[float], k_values: Sequence[int]) int[source]
Choose K the way Prior 2024
habitat_computation.optimal_kdoes.They fit GMM for
kin 1..5, takenp.gradientof the BIC curve, then the first difference of that slope, and pick thekat the largest absolute change of slope (theiri_max + 1index intok_list). This is not minimum-BIC.- Parameters:
bic_scores – One BIC per candidate
k, same order ask_values. Need at least three candidates.k_values – Candidate habitat counts (Prior used
range(1, 6)).
- Returns:
The selected
k.- Raises:
ValueError – If the two sequences differ in length or are shorter than three points (their second-difference needs three gaps).