HnswParam: The HnswParam class

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

View source: R/HnswParam-class.R

Description

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

Usage

1
2
3
4
5
6
7
HnswParam(
  nlinks = 16,
  ef.construction = 200,
  directory = tempdir(),
  ef.search = 10,
  distance = "Euclidean"
)

Arguments

nlinks

Integer scalar, number of bi-directional links per element for index generation.

ef.construction

Integer scalar, size of the dynamic list for index generation.

directory

String specifying the directory in which to save the index.

ef.search

Integer scalar, size of the dynamic list for neighbor searching.

distance

A string specifying the distance metric to use.

Details

The HnswParam class holds any parameters associated with running the HNSW algorithm. This generally relates to building of the index - see buildHnsw 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 HnswParam class.

Author(s)

Aaron Lun

See Also

buildHnsw, for the index construction.

findHnsw and related functions, for the actual search.

BiocNeighborParam, for the parent class and its available methods.

Examples

1
2
3
4
5
(out <- HnswParam())
out[['nlinks']]

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

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