[experimental] Compute polarity scores with different hyper-parameters
Source:R/bootstrap.R
bootstrap_lss.Rd
A function to compute polarity scores of words and documents by resampling hyper-parameters from a fitted LSS model.
Arguments
- x
a fitted textmodel_lss object.
- what
choose the hyper-parameter to resample in bootstrapping.
- mode
choose the type of the result of bootstrapping. If
coef
, returns the polarity scores of words; ifterms
, returns words sorted by the polarity scores in descending order; ifpredict
, returns the polarity scores of documents.- remove
if
TRUE
, remove each seed word whenwhat = "seeds"
.- from, to, by
passed to
seq()
to generate values fork
; only used whenwhat = "k"
.- verbose
show messages if
TRUE
.- ...
additional arguments passed to
as.textmodel_lss()
andpredict()
.
Details
bootstrap_lss()
creates LSS fitted textmodel_lss objects internally by
resampling hyper-parameters and computes polarity of words or documents.
The resulting matrix can be used to asses the validity and the reliability
of seeds or k.
Note that the objects created by as.textmodel_lss()
does not contain data, users
must pass newdata
via ...
when mode = "predict"
.