View source: R/textmodel_wordscores.R
predict.textmodel_wordscores | R Documentation |
Predict textmodel_wordscores
## S3 method for class 'textmodel_wordscores'
predict(
object,
newdata = NULL,
se.fit = FALSE,
interval = c("none", "confidence"),
level = 0.95,
rescaling = c("none", "lbg", "mv"),
force = TRUE,
...
)
object |
a fitted Wordscores textmodel |
newdata |
dfm on which prediction should be made |
se.fit |
if |
interval |
type of confidence interval calculation |
level |
tolerance/confidence level for intervals |
rescaling |
|
force |
make the feature set of |
... |
not used |
predict.textmodel_wordscores()
returns a named vector of predicted
document scores ("text scores" S_{vd}
in LBG 2003), or a named list if
se.fit = TRUE
consisting of the predicted scores ($fit
) and the
associated standard errors ($se.fit
). When interval = "confidence"
, the predicted values will be a matrix. This behaviour matches
that of stats::predict.lm()
.
tmod <- textmodel_wordscores(quanteda::data_dfm_lbgexample, c(seq(-1.5, 1.5, .75), NA))
predict(tmod)
predict(tmod, rescaling = "mv")
predict(tmod, rescaling = "lbg")
predict(tmod, se.fit = TRUE)
predict(tmod, se.fit = TRUE, interval = "confidence")
predict(tmod, se.fit = TRUE, interval = "confidence", rescaling = "lbg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.