KNN Error - here were 50 or more warnings (use warnings() to see the first 50)

I'm getting an argument error for knn model. Getting error in the last argument
Here's the full code

library(readxl)

file <- read_excel("C:/Users/Desktop/file.xlsx")
library(caret)
library(pROC)
library(mlbench)
set.seed(1234)
independentdata<-sample(2,nrow(file),replace=T,prob=c(0.7,0.3))
training<-file[independentdata==1,]
test<-file[independentdata==2,]
trcontrol_var<-trainControl(method='repeatedcv',number=10,repeats=3)
set.seed(222)
fit<-train(admit ~ ., data=training,method='knn',tuneLength=20,trControl=trControl,preProc=c("Center","Scale"))
here were 50 or more warnings (use warnings() to see the first 50)

warnings are not errors. They provide (sometimes) useful information about what yu have just run.

It is worth checking the warnings until you become familiar with them to make sure there is nothing unexpected in the warnings.

1 Like

Thanks for getting me up to speed

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.