powered by
Finds optimal K value for KNN.
find_best_k(X, y, k_values = seq(1, 15, 2))
numeric best k
features
labels
for k value
Provides functionality for find_best_k operations.
VectorForgeML-package
x <- matrix(rnorm(200), nrow=100) y <- sample(0:1, 100, replace=TRUE) find_best_k(x, y, k_values=c(1,3,5))
Run the code above in your browser using DataLab