createKnnMatrix: Function to create a knn matrix

View source: R/VarID_functions.R

createKnnMatrixR Documentation

Function to create a knn matrix

Description

This creates an adjacency matrix, keeping only nearest neighbour with a link probability above a minimum probability

Usage

createKnnMatrix(res, pvalue = 0.01)

Arguments

res

List object with k nearest neighbour information returned by pruneKnn function.

pvalue

Positive real number between 0 and 1. All nearest neighbours with link probability < pvalue are discarded. Default is 0.01.

Value

Adjacency matrix in sparse matrix format (see package Matrix) with positive non-zero entries only for k nearest neighours with link probability >= pvalue. The value of these entries equals the link probability.

Examples

res <- pruneKnn(intestinalDataSmall,knn=10,alpha=1,no_cores=1,FSelect=FALSE)
y <- createKnnMatrix(res,pvalue=0.01)

RaceID documentation built on April 4, 2025, 4:34 a.m.