RNNConstruction: Building Unweighted epsilon Nearest Neighbor Graph

Description Usage Arguments Details Value Examples

Description

This function builds an ε Nearest Neighbor graph in the input feature space using Euclidean distance metric.

Usage

1
RNN.Construction(mat, max_dist)

Arguments

mat

the input data saved as a numerical matrix. The columns are the features and the rows are the samples.

max_dist

the threshold distance. The edges whose lengths are less than max_dist will be kept in the graph.

Details

The function builds an ε Nearest Neighbor graph which saved as a sparse matrix.

Value

An n by n binary dgCMatrix object C, where n is the number of input samples. The matrix C is the adjacency matrix of the built RNN graph. C[i,j] = 1 means that there is an edge between sample i and sample j.

Examples

1
2
3
data(Pollen)
Pollen.PCs <- Pollen[["PCs"]]
G <- RNN.Construction(Pollen.PCs, 20)

XuegongLab/HGC documentation built on Dec. 18, 2021, 7:23 p.m.