View source: R/SpectralClustering.R
affinity_matrix | R Documentation |
Generate a symmetric affinity matrix based on a distance matrix using 'local' Gaussian kernel
affinity_matrix(D, k, alpha = 1/6, beta = 1/6)
D |
distance matrix (need to be a square and non-negative matrix) |
k |
the number of k-nearest neighbors |
alpha |
coefficient for local diameters. Default value: 1/6. This default value should work for most cases. |
beta |
coefficient for pair-wise distance. Default value: 1/6. This default value should work for most cases. |
an affinity matrix
D = matrix(runif(400), nrow=20)
A = affinity_matrix(D, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.