KmknnIndex: The KmknnIndex class

View source: R/KmknnIndex-class.R

KmknnIndexR Documentation

The KmknnIndex class

Description

A class to hold indexing structures for the KMKNN algorithm for exact nearest neighbor identification.

Usage

KmknnIndex(data, centers, info, order, NAMES = NULL, distance = "Euclidean")

Arguments

data

A numeric matrix where columns correspond to data points and rows correspond to dimensions.

centers

A numeric matrix containing coordinates for cluster centroids, with clusters in columns and dimensions in rows.

info

A list containing additional information for each cluster, see buildKmknn for details.

order

An integer vector of length equal to ncol(data), specifying the order of points in x relative to the original data matrix.

NAMES

A character vector of sample names or NULL.

distance

A string specifying the distance metric to use.

Details

The KmknnIndex class holds the indexing structure required to run the KMKNN algorithm. Users should never need to call the constructor explicitly, but should generate instances of KmknnIndex classes with buildKmknn.

Users can get values from an HnswIndex object with the usual [[ syntax. All parameters listed in the constructor can be extracted in this manner.

Value

An instance of the KmknnIndex class.

Author(s)

Aaron Lun

See Also

buildKmknn, to build the index.

BiocNeighborIndex, for the parent class and its available methods.

Examples

example(buildKmknn)
out[['centers']]
out[['info']]


LTLA/kmknn documentation built on Feb. 5, 2024, 6:03 p.m.