predict.textmodel_affinity: Prediction for a fitted affinity textmodel

Description Usage Arguments Value See Also

Description

Estimate θ_i for each document, from a fitted textmodel_affinity object.

Other methods below provide standard ways to extract or compute quantities from predicted textmodel_affinity objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S3 method for class 'textmodel_affinity'
predict(object, newdata = NULL,
  level = 0.95, ...)

## S3 method for class 'predict.textmodel_affinity'
coef(object, ...)

## S3 method for class 'predict.textmodel_affinity'
residuals(object,
  type = c("response", "pearson"), ...)

## S3 method for class 'predict.textmodel_affinity'
rstandard(model, ...)

Arguments

object

a fitted affinity textmodel

newdata

dfm on which prediction should be made

level

probability level for confidence interval width

...

unused

type

see residuals.lm

Value

predict() returns a list of predicted affinity textmodel quantities.

coef() returns a document \times class matrix of class affinities for each document.

residuals() returns a document-by-feature matrix of residuals. resid() is an alias.

rstandard() is a shortcut to return the pearson residuals.

See Also

influence.predict.textmodel_affinity for methods of computing the influence of particular features from a predicted textmodel_affinity model.


quanteda/quanteda documentation built on June 26, 2019, 3:38 a.m.