buildKmknn: Pre-cluster points with k-means

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/buildKmknn.R

Description

Perform k-means clustering in preparation for a KMKNN nearest-neighbors search.

Usage

1
buildKmknn(X, transposed=FALSE, distance=c("Euclidean", "Manhattan"), ...)

Arguments

X

A numeric matrix where rows correspond to data points and columns correspond to variables (i.e., dimensions).

transposed

Logical scalar indicating whether X is transposed, i.e., rows are variables and columns are data points.

distance

String specifying the type of distance to use.

...

Further arguments to pass to kmeans.

Details

This function is automatically called by findKmknn and related functions. However, it can be called directly by the user to save time if multiple queries are to be performed to the same X.

Value

A KmknnIndex object containing:

Author(s)

Aaron Lun

See Also

See kmeans for optional arguments.

See KmknnIndex for details on the output class.

See findKmknn, queryKmknn and findNeighbors for dependent functions.

Examples

1
2
3
Y <- matrix(rnorm(100000), ncol=20)
out <- buildKmknn(Y)
out

BiocNeighbors documentation built on Dec. 9, 2020, 2:01 a.m.