predict.textmodel_newsmap: Prediction method for textmodel_newsmap

View source: R/predict.R

predict.textmodel_newsmapR Documentation

Prediction method for textmodel_newsmap

Description

Predict document class using trained a Newsmap model

Usage

## S3 method for class 'textmodel_newsmap'
predict(
  object,
  newdata = NULL,
  confidence = FALSE,
  rank = 1L,
  type = c("top", "all"),
  rescale = FALSE,
  min_conf = -Inf,
  min_n = 0L,
  ...
)

Arguments

object

a fitted Newsmap textmodel.

newdata

dfm on which prediction should be made.

confidence

if TRUE, it returns likelihood ratio score.

rank

rank of the class to be predicted. Only used when type = "top".

type

if top, returns the most likely class specified by rank; otherwise return a matrix of likelihood ratio scores for all possible classes.

rescale

if TRUE, likelihood ratio scores are normalized using scale(). This affects both types of results.

min_conf

return NA when confidence is lower than this value.

min_n

set the minimum number of polarity words in documents.

...

not used.


koheiw/Newsmap documentation built on April 14, 2024, 3:26 a.m.