View source: R/radius_graphs.R
| create.cknn.graph | R Documentation |
Creates an undirected continuous-kNN graph using local scale distances.
Let \sigma_i be the distance from observation i to its
k.scale-th non-self nearest neighbor. Vertices are adjacent when
\|x_i - x_j\|_2 \le \delta \sqrt{\sigma_i\sigma_j}.
This is a convenience wrapper around create.rknn.graph() with
type = "adaptive.radius" and radius.rule = "geomean". It is useful as
a named data-derived graph construction in geodesic reconstruction
benchmarks.
create.cknn.graph(
X,
k.scale,
delta = 1,
radius.search = c("ann", "all.pairs"),
return.timing = FALSE,
graph.detail = c("full", "minimal"),
prune.method = c("none", "local.geodesic", "global.geodesic.ratio"),
max.path.edge.ratio.deviation.thld = 0.1,
path.edge.ratio.percentile = 0.5,
prune.tau = 1.05,
prune.local.k = NULL,
with.pruned.edge.stats = FALSE,
connect.components = FALSE,
connect.method = c("component.mst", "component.mst.ann", "global.mst"),
bridge.k = NULL,
bridge.k.max = NULL,
bridge.growth = 2
)
X |
Numeric matrix or data frame with observations in rows. |
k.scale |
Positive integer smaller than |
delta |
Positive numeric scalar multiplying the geometric-mean adaptive radius. |
radius.search |
Character scalar. |
return.timing |
Logical scalar. If |
graph.detail |
Character scalar. |
prune.method |
Character scalar. |
max.path.edge.ratio.deviation.thld |
Numeric scalar in |
path.edge.ratio.percentile |
Numeric scalar in |
prune.tau |
Numeric scalar greater than 1. For local geometric pruning, an edge may be removed when a retained local alternative path is at most this multiplicative factor times the direct edge length. |
prune.local.k |
Integer scalar or |
with.pruned.edge.stats |
Logical scalar. If |
connect.components |
Logical scalar. If |
connect.method |
Character scalar. |
bridge.k |
Integer scalar or |
bridge.k.max |
Integer scalar or |
bridge.growth |
Numeric scalar greater than 1. Multiplicative growth factor for ANN bridge neighborhoods. |
A list inheriting from "cknn_graph" and "adaptive_radius_graph".
It contains the same lifecycle fields as create.rknn.graph() with
type = "adaptive.radius", radius_rule = "geomean",
radius_factor = delta, and graph_rule = "continuous.knn".
X <- matrix(c(0, 1, 3), ncol = 1)
create.cknn.graph(X, k.scale = 1, delta = 1)$edge_matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.