Predict documents with a fitted HyperGAT classifier
Source:R/text_hypergat_fit.R
predict.hg_hypergat.RdReuses the trained network, vocabulary, preprocessing and topic keywords. Words absent from the fitted vocabulary are ignored. A document with no remaining words receives missing predictions and a warning, preserving its row and id. The winning softmax probability is a model score, not a calibrated probability of correctness.
Arguments
- object
A fitted
hg_hypergat.- newdata
A character vector or data frame of new documents.
NULLreturns the original predictions.- column, id
Text and id columns of a data frame. Defaults to the columns used when fitting. An unnamed character vector receives sequential document ids.
- labels
Optional observed labels for
newdata, in the same formats ashg_hypergat(). Supplying them evaluates the predictions throughhg_get.hg_classification()andplot(). These labels never update the model. Unscorable labelled documents count as errors.- type
"predictions"(default), a document table, or"probabilities", a matrix with one column per fitted class.- ...
Unused.