AnnoyIndex: The AnnoyIndex class

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

View source: R/Annoy-class.R

Description

A class to hold indexing structures for the Annoy algorithm for approximate nearest neighbor identification.

Usage

1
2
3
4
5
6
AnnoyIndex(data, path, search.mult=50, NAMES=NULL, distance="Euclidean")

AnnoyIndex_path(x)

## S4 method for signature 'AnnoyIndex'
show(object)

Arguments

data

A numeric matrix with data points in columns and dimensions in rows.

path

A string specifying the path to the index file.

search.mult

Numeric scalar, multiplier for the number of points to search.

NAMES

A character vector of sample names or NULL.

distance

A string specifying the distance metric to use.

x, object

A AnnoyIndex object.

Details

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

Value

The AnnoyIndex constructor will return an instance of the AnnoyIndex class.

AnnoyIndex_path will return the path to the index file.

AnnoyIndex_search_mult will return the multiplier for the number of points to search.

Author(s)

Aaron Lun

See Also

buildAnnoy

Examples

1
2

Example output

bldAnn> Y <- matrix(rnorm(100000), ncol=20)

bldAnn> out <- buildAnnoy(Y)

bldAnn> out
class: AnnoyIndex
dim: 5000 20
distance: Euclidean
path: /work/tmp/tmp/Rtmp8ahs3o/file5786632af806.idx
search multiplier: 50
 chr "/work/tmp/tmp/Rtmp8ahs3o/file5786632af806.idx"

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