#Read the CSV(Comma Separated Values) file and store it in cars
Churn <- read.csv(file = "C:/Users/rizod/Desktop/data/Churn.txt", stringsAsFactors = FALSE)
#Show the new DataFrame "Churn" #Display cars
Churn
knn(data,
new,
cl=trueclass,
k=3,
prob=TRUE)
当我尝试使用此数据集运行KNN时,我一直收到此错误
"Error in knn(data, new, cl = trueclass, k = 5, prob = TRUE) : 'train' and 'class' have different lengths