Learn R Programming

VectorForgeML (version 0.1.0)

find_best_k: Find Best K

Description

Finds optimal K value for KNN.

Usage

find_best_k(X, y, k_values = seq(1, 15, 2))

Value

numeric best k

Arguments

X

features

y

labels

k_values

for k value

Details

Provides functionality for find_best_k operations.

See Also

VectorForgeML-package

Examples

Run this code
  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