predict.textmodel_svmlin: Prediction from a fitted textmodel_svmlin object

View source: R/textmodel_svmlin.R

predict.textmodel_svmlinR Documentation

Prediction from a fitted textmodel_svmlin object

Description

predict.textmodel_svmlin() implements class predictions from a fitted linear SVM model.

Usage

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

Arguments

object

a fitted linear SVM textmodel

newdata

dfm on which prediction should be made

type

the type of predicted values to be returned; see Value

force

logical, if TRUE, make newdata's feature set conformant to the model terms

...

not used

Value

predict.textmodel_svmlin 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_svmlin()


quanteda.textmodels documentation built on March 31, 2023, 8:09 p.m.