0

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.

Renato Lyke
  • 43
  • 10

1 Answers1

0

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 ...

Florian
  • 597
  • 3
  • 9