load("C:/BLOG/Workspaces/NIT Tutorial/NIT_ws17.RData")
library(tidyverse)
library(caret)
library(earth)
library(Monitor)
Let´s load first the previous workspace and the libraries needed.
KNN model for Protein
set.seed(100)
<- train(x = tec2_prot_train$snvdt2der2_spec, y = tec2_prot_train$Protein,
knn_tec_prot method = "knn",
tuneGrid = data.frame(.k = 1:20),
preproc = c("center", "scale"),
trControl = trainControl(method = "cv"))