kNN_graph: Calculate k-nearest-neighbor graph from affinity matrix and...

Description Usage Arguments Value Examples

View source: R/AffinityNetworkFusion.R

Description

Calculate k-nearest-neighbor graph from affinity matrix and normalize it as transition matrix

Usage

1
kNN_graph(W, K)

Arguments

W

affinity matrix (its elements are non-negative real numbers)

K

the number of k nearest neighbors

Value

a transition matrix of the same shape as W

Examples

1
2
3
D = matrix(runif(400),20)
W = affinity_matrix(D, 5)
S = kNN_graph(W, 5)

Example output



ANF documentation built on Nov. 8, 2020, 7:51 p.m.