0
votes

I am trying to do some text mining over 35000 rows of data, and when i try to create the model from modeldata, I take the rows that I decided to use for training and test. And, I also feed the known categories of the training data into the model.

I am getting this error .

Error in knn(modeldata[train, ], modeldata[test, ], cl[train]) : too many ties in knn

Any suggestions how to fix it.

I have set the seed for 100.

Regards, Ren.

1
Maybe this will help.RobertMyles
I tried the same and still the error messageRenato Lyke
I don't know much about this function, you could raise an issue on the package github repo, if it has one.RobertMyles
Thanks will try it over thereRenato Lyke

1 Answers

0
votes

It seems that the source code defines the maximum number of ties to be 1000. See here for an answer at the R mailing list or here for the source.

If you simulate your data maybe you should think about if your data simulation scheme is realistic. Alternative you cloud try different implementations like, https://CRAN.R-project.org/package=kknn https://CRAN.R-project.org/package=FNN ...