graphclust.graphs.shared_neighbor_counts#
- graphclust.graphs.shared_neighbor_counts(X, k=10, *, include_self=True)[source]#
Number of shared \(k\)-nearest neighbors \(m_{ij}=|A_i\cap A_j|\) for every pair.
Returns a dense integer matrix and the neighbor index array. With
include_self=Trueevery sample is counted as its own neighbor, the convention of the original Jarvis–Patrick implementation.