cross_adjacency | R Documentation |
This function computes the cross adjacency matrix or graph between two sets of points based on their k-nearest neighbors and a kernel function applied to their distances.
cross_adjacency(
X,
Y,
k = 5,
FUN = heat_kernel,
type = c("normal", "mutual", "asym"),
as = c("igraph", "sparse", "index_sim")
)
X |
A matrix of size nXk, where n is the number of data points and k is the dimensionality of the feature space. |
Y |
A matrix of size pXk, where p is the number of query points and k is the dimensionality of the feature space. |
k |
An integer indicating the number of nearest neighbors to consider (default: 5). |
FUN |
A kernel function to apply to the Euclidean distances between data points (default: heat_kernel). |
type |
A character string indicating the type of adjacency to compute. One of "normal", "mutual", or "asym" (default: "normal"). |
as |
A character string indicating the format of the output. One of "igraph", "sparse", or "index_sim" (default: "igraph"). |
If 'as' is "index_sim", a two-column matrix where the first column contains the indices of nearest neighbors and the second column contains the corresponding kernel values. If 'as' is "igraph", an igraph object representing the cross adjacency graph. If 'as' is "sparse", a sparse adjacency matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.