AnnoyParam: The AnnoyParam class

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

View source: R/AnnoyParam-class.R

Description

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

Usage

1
2
3
4
5
6
AnnoyParam(
  ntrees = 50,
  directory = tempdir(),
  search.mult = ntrees,
  distance = "Euclidean"
)

Arguments

ntrees

Integer scalar, number of trees to use for index generation.

directory

String containing the path to the directory in which to save the index.

search.mult

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

distance

String, the distance metric to use.

Details

The AnnoyParam class holds all parameters associated with running the Annoy algorithm. Most of these parameters are used to build the index - see buildAnnoy for details.

Users can get or set values with the usual [[ syntax. All parameters listed in the constructor can be manipulated in this manner.

Value

An instance of the AnnoyParam class.

Author(s)

Aaron Lun

See Also

buildAnnoy, for the index construction.

findAnnoy and related functions, for the actual search.

BiocNeighborParam, for the parent class and its available methods.

Examples

1
2
3
4
5
(out <- AnnoyParam())
out[['ntrees']]

out[['ntrees']] <- 20L
out

LTLA/BiocNeighbors documentation built on Sept. 18, 2021, 8:19 p.m.