| SL.kernelKnn | R Documentation |
Wrapper for a configurable implementation of k-nearest neighbors. Supports both binomial and gaussian outcome distributions.
SL.kernelKnn(
Y,
X,
newX,
family,
k = 10,
method = "euclidean",
weights_function = NULL,
extrema = F,
h = 1,
...
)
Y |
Outcome variable |
X |
Training dataframe |
newX |
Test dataframe |
family |
Gaussian or binomial |
k |
Number of nearest neighbors to use |
method |
Distance method, can be 'euclidean' (default), 'manhattan', 'chebyshev', 'canberra', 'braycurtis', 'pearson_correlation', 'simple_matching_coefficient', 'minkowski' (by default the order 'p' of the minkowski parameter equals k), 'hamming', 'mahalanobis', 'jaccard_coefficient', 'Rao_coefficient' |
weights_function |
Weighting method for combining the nearest neighbors. Can be 'uniform' (default), 'triangular', 'epanechnikov', 'biweight', 'triweight', 'tricube', 'gaussian', 'cosine', 'logistic', 'gaussianSimple', 'silverman', 'inverse', 'exponential'. |
extrema |
if TRUE then the minimum and maximum values from the k-nearest-neighbors will be removed (can be thought as outlier removal). |
h |
the bandwidth, applicable if the weights_function is not NULL. Defaults to 1.0. |
... |
Any additional parameters |
List with predictions and the original training data & hyperparameters.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.