Description Usage Arguments Value Examples
Aggregate point-wise distances over k nearest neighbors
1 | aggregate_knn(data, fun, k)
|
data |
A numeric matrix, data frame or distance matrix |
fun |
A function to aggregate point-wise distances |
k |
An integer specifying number of nearest neighbors used to compute aggregation |
A numeric vector
1 2 | aggregate_knn(iris[, -5], mean, 3) # average 3-nn
aggregate_knn(dist(iris[, -5]), max, 5) # equivalent to exact 5-nn
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.