public class NearestNeighborsClient extends Object
Constructor and Description |
---|
NearestNeighborsClient(String url) |
Modifier and Type | Method and Description |
---|---|
protected com.mashape.unirest.request.HttpRequest |
addAuthHeader(com.mashape.unirest.request.HttpRequest request)
Add the specified authentication header to the specified HttpRequest
|
NearestNeighborsResults |
knn(int index,
int k)
Runs knn on the given index
with the given k (note that this is for data
already within the existing dataset not new data)
|
NearestNeighborsResults |
knnNew(int k,
INDArray arr)
Run a k nearest neighbors search
on a NEW data point
|
protected String authToken
public NearestNeighborsClient(String url)
public NearestNeighborsResults knn(int index, int k) throws Exception
index
- the index of the
EXISTING ndarray
to run a search onk
- the number of resultsException
public NearestNeighborsResults knnNew(int k, INDArray arr) throws Exception
k
- the number of results
to retrievearr
- the array to run the search on.
Note that this must be a row vectorException
protected com.mashape.unirest.request.HttpRequest addAuthHeader(com.mashape.unirest.request.HttpRequest request)
request
- HTTP Request to add the authentication header toCopyright © 2020. All rights reserved.