gdKNearestNeighbors | R Documentation |
Search for k nearest neighbors in generative data for a data record. When the data record contains NA values only the non-NA values are considered in search. By default a linear search is performed. When a search tree is used search is performed on a tree which is built once in the first function call. Building a tree is also triggered when NA values in data records change in subsequent function calls.
gdKNearestNeighbors(dataRecord, k = 1L, useSearchTree = FALSE)
dataRecord |
List containing a data record |
k |
Number of nearest neighbors |
useSearchTree |
Boolean value indicating if a search tree should be used. |
A list of rows in generative data
## Not run:
gdRead("gd.bin")
gdKNearestNeighbors(list(5.1, 3.5, 1.4, 0.2), 3)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.