predict.textmodel_cnnlstmemb: Prediction from a fitted textmodel_cnnlstmemb object

View source: R/textmodel_cnnlstmemb.R

predict.textmodel_cnnlstmembR Documentation

Prediction from a fitted textmodel_cnnlstmemb object

Description

predict.textmodel_cnnlstmemb() implements class predictions from a fitted long short-term memory neural network model.

Usage

## S3 method for class 'textmodel_cnnlstmemb'
predict(
  object,
  newdata = NULL,
  type = c("class", "probability"),
  force = TRUE,
  ...
)

Arguments

object

a fitted textmodel_cnnlstmemb model

newdata

dfm on which prediction should be made

type

the type of predicted values to be returned; see Value

force

make newdata's feature set conformant to the model terms

...

not used

Value

predict.textmodel_cnnlstmemb returns either a vector of class predictions for each row of newdata (when type = "class"), or a document-by-class matrix of class probabilities (when type = "probability").

See Also

textmodel_cnnlstmemb()


quanteda/quanteda.classifiers documentation built on Oct. 20, 2023, 6:53 a.m.