State metrics module¶
- sekupy.analysis.states.metrics.gap(X, labels, nrefs=20, refs=None)[source]¶
Compute the Gap statistic for an nxm dataset in X. Either give a precomputed set of reference distributions in refs as an (n,m,k) scipy array, or state the number k of reference distributions in nrefs for automatic generation with a uniformed distribution within the bounding box of X. Give the list of k-values for which you want to compute the statistic in ks.