Description Usage Arguments Value
Make predictions on a data point x_query
based on the k-nearest neighbors in the dataset
X
. Predictions are made by averaging the
Y
values of the k-neighest neighbors.
1 | predict_knn(X, Y, x_query, k, dist_func = mydist, ...)
|
X |
dataset of shape [n_samples, n_features] |
Y |
target vector of shape [n_samples] |
x_query |
vector of shape [n_features] to make predictions on. |
k |
number of nearest neighbors to use for predictions. |
dist_func |
function used to calculate the distance between two points. |
... |
These arguments are passed into |
A single prediction for x_query
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.