knn_simMat | R Documentation |
The transition probability from cluster i to j is the fraction of neighbours of all samples in cluster i that belongs to cluster j. Note, this matrix is asymmetric, so as the input KNN connection matrix.
knn_simMat(KNN_matrix, clusters)
KNN_matrix |
a sparse binary matrix with size (n_sample, n_sample). x_ij=1 means sample j is a neighbour of sample i. As definition, we expect sum(KNN_matrix) = n_sample * K, where K is the number neighbours. |
clusters |
a (n_sample, ) vector of cluster id for each sample. |
a similarity matrix calculated based on the knn graph.
data(simulation) knn_mat = knn_simMat(simulation$knnGraphs, simulation$labels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.