regressoR (version 1.1.7)

kkn_model: kkn_model

Description

generates the code to create the k nearest neighbors model.

Usage

kkn_model(data = "datos.aprendizaje", variable.pred = NULL,
  scale = TRUE, kmax = 7, kernel = "optimal",
  model.var = "modelo.knn", distance = 2)

Arguments

data

the name of the learning data.

variable.pred

the name of the variable to be predicted.

scale

the scale parameter of the model.

kmax

the kmax parameter of the model.

kernel

the kernel parameter of the model.

model.var

the name of the variable that stores the resulting model.

distance

the distance parameter of the model.

See Also

train.kknn

Examples

Run this code
# NOT RUN {
library(kknn)
x <- kkn_model('iris', 'Petal.Length')
exe(x)
print(modelo.knn)

# }

Run the code above in your browser using DataLab