Learn R Programming

quanteda (version 0.9.8.5)

predict.textmodel_NB_fitted: prediction method for Naive Bayes classifier objects

Description

implements class predictions using trained Naive Bayes examples

Usage

"predict"(object, newdata = NULL, ...)

Arguments

object
a fitted Naive Bayes textmodel
newdata
dfm on which prediction should be made
...
not used

Value

A list of two data frames, named docs and words corresponding to word- and document-level predicted quantities

Examples

Run this code
(nbfit <- textmodel_NB(LBGexample, c("A", "A", "B", "C", "C", NA)))
(nbpred <- predict(nbfit))

Run the code above in your browser using DataLab