hatvis.seriation.barycentric_order#

hatvis.seriation.barycentric_order(X, n_iter=10, axis=0)[source]#

Iterative barycentric order of the rows (axis=0) or columns (axis=1) of a matrix.

With the co-occurrence matrix \(\mathbf{C}=\mathbf{X}\mathbf{X}^\mathsf{T}\) and the current rank vector \(\mathbf{x}\), every row gets the position \(b_i=\sum_n c_{in}x_n/\sum_n c_{in}\) and the rows are re-ranked by \(b\). This is the sorting step of the HAT-VIS scripts (ten iterations by default); it stops early when the order no longer changes. Empty rows are moved to the end.