Error While using KNN model

Error in knn(train = trainData1, test = testData1, cl = p_tl, k = 3, prob = TRUE) :
NA/NaN/Inf in foreign function call (arg 6)
In addition: Warning messages:
1: In knn(train = trainData1, test = testData1, cl = p_tl, k = 3, prob = TRUE) :
NAs introduced by coercion
2: In knn(train = trainData1, test = testData1, cl = p_tl, k = 3, prob = TRUE) :
NAs introduced by coercion

We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.