Displaying 1 result from an estimated 1 matches for "elemnet".
Did you mean:
element
2005 Mar 15
1
KNN one factor predicting problem
...lease?
> cl<-as.factor(traindata[,13])
> knn(traindata[1:295,2], newdata[1:32,2], cl,k=2,
prob=TRUE)
Error in knn(traindata[1:295, 2], newdata[1:32, 2],
cl, k = m, prob = TRUE) :
Dims of test and train differ
Both traindata and newdata have 13 elements. Only one
of the first 12 elemnets is needed to predict the 13
element.
What's the problem of following commands?
Thank you very much indeed
Qin