affinity_matrix: Generate a symmetric affinity matrix based on a distance...

Description Usage Arguments Value Examples

View source: R/SpectralClustering.R

Description

Generate a symmetric affinity matrix based on a distance matrix using 'local' Gaussian kernel

Usage

1
affinity_matrix(D, k, alpha = 1/6, beta = 1/6)

Arguments

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.

Value

an affinity matrix

Examples

1
2
D = matrix(runif(400), nrow=20)
A = affinity_matrix(D, 5)

Example output



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