-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Predictions using textmodel_NB #129
Comments
Fixed in 0.9.5-25 (2051d5c). |
It will now work with your code, which I have tidied up:
Your call to predict used an incorrect second argument, it needs to be a dfm (for |
Hey Ken, When I executed your code I received the following error from predict(): Error in predict.textmodel_NB_fitted(bbcNb, newdata = bbc_dfm[1781:2225, : Can you confirm if you receive the same error? Thank you, Matt
|
I just verified that it works. Just pushed the newest build to CRAN.
|
Thank you, it's working now with the latest version installed. Would you mind shedding light on why calculating the confusion matrix as |
bbc_pred is a list, you probably want just the predicted class. That would be: bbc_pred$nb.predicted I will be adding accessor functions for these very soon, similar to coef(lm.class.object). Ken On 10 May 2016, at 05:21, Matt Kalebic <notifications@github.commailto:notifications@github.com> wrote: Thank you, it's working now with the latest version installed. Would you mind shedding light on why calculating the confusion matrix as confusionMatrix(bbc_pred, testclass) gives the error Error in sort.list(y) : 'x' must be atomic for 'sort.list' — |
See Stack Overflow for original post
I have a dataset of BBC articles with two columns: 'category' and 'text'. I need to construct a Naive Bayes algorithm that predicts the category (i.e. business, entertainment) of an article based on type.
I'm attempting this with Quanteda and have the following code:
Here is a link to the dataset.
Ken noted that there is a bug in the predict method when k > 2.
The text was updated successfully, but these errors were encountered: