Learn R Programming

VectorForgeML (version 0.1.0)

KNN-class: K-Nearest Neighbors Model

Description

Instance-based learning algorithm.

Arguments

Value

KNN object

Details

Provides functionality for KNN operations.

See Also

VectorForgeML-package

Examples

Run this code
  model <- KNN$new(k=3, mode="classification")
  X <- matrix(rnorm(20), nrow=10)
  y <- sample(0:1, 10, replace=TRUE)
  model$fit(X,y)
  model$predict(X)

Run the code above in your browser using DataLab