0

I am trying to fit a model to dfm I created using quanteda. I am getting the following error. Any ideas??

tModel <- textmodel(udfm1,model = "NB", smooth=1)

Error in textmodel(udfm1, model = "NB", smooth = 1) : 
model NB not implemented. 

p.s. I am creating a model to predict the next word for mobile application. I only know Naive Bayes and am not familiar with the other models in this package. So feel free to recommend.

PeterV
  • 195
  • 1
  • 13

1 Answers1

1

Apologies for this: while the ?textmodel indicates that "NB" is an available model, in fact as of quanteda v0.9.1-7 it's not yet implemented. I have code that implements multinomial and Bernoulli Naive Bayes as a textmodel type but we moved it to a development branch pending more testing. (But coming soon.)

For predicting the next word, that sounds like a question for the text-mining tag of Cross-Validated. Nothing directly in quanteda yet for this, but you should be able to use the dfm directly with most classifiers and regression models.

Community
  • 1
  • 1
Ken Benoit
  • 14,454
  • 27
  • 50
  • thanks. I have added the other two tags to this post. So hopefully, someone can recommend which of the following model in quanteda would be suitable for text prediction (wordscores, ca, wordfish) – PeterV Dec 29 '15 at 14:58