AnnoyParam: The AnnoyParam class

View source: R/AnnoyParam-class.R

AnnoyParamR Documentation

The AnnoyParam class

Description

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

Usage

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

(out <- AnnoyParam())
out[['ntrees']]

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


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