nearest_neighbors: Nearest Neighbors

Description Usage Arguments Value

View source: R/neighbors.R

Description

Find the k nearest neighbors from a point x_query and all rows in a dataset X.

Usage

1
nearest_neighbors(X, x_query, k, dist_func = mydist, ...)

Arguments

X

Feature matrix of shape [n_samples, n_features].

x_query

A single vector of shape [n_features].

k

The number of nearest neighbors to compute.

dist_func

A function that defines a valid distance. The default is euclidean distance.

...

These parameters are passed into dist_func.

Value

The indices of the k-nearest neighbors.


joshloyal/STAT542 documentation built on May 4, 2019, 1:08 p.m.