0

I am working on a text mining project using to classify test using Naive Bayes.

When I build a Naive Bayes classifier using

classifier<-naiveBayes(training, type)

then run the predict function on test data:

pred <- predict(classifier, test)

I get:

Error in object$tables[[v]][, nd] : subscript out of bounds

What would be the cause of this error?

alandalusi
  • 1,145
  • 4
  • 18
  • 39
  • 2
    Please provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Molx May 09 '15 at 23:38

1 Answers1

0

The training and testing data was a Matrix of Characters. When I converted into Numeric, I never faced this problem again.

alandalusi
  • 1,145
  • 4
  • 18
  • 39