shap.utils.hclust_ordering

shap.utils.hclust_ordering(X: NDArray[Any], metric: str = 'sqeuclidean', anchor_first: bool = False) NDArray[Any]

A leaf ordering is under-defined, this picks the ordering that keeps nearby samples similar.