bootstrap_lss: [experimental] Compute polarity scores with different...

View source: R/bootstrap.R

bootstrap_lssR Documentation

[experimental] Compute polarity scores with different hyper-parameters

Description

A function to compute polarity scores of words and documents by resampling hyper-parameters from a fitted LSS model.

Usage

bootstrap_lss(
  x,
  what = c("seeds", "k"),
  mode = c("terms", "coef", "predict"),
  remove = FALSE,
  from = 50,
  to = NULL,
  by = 50,
  verbose = FALSE,
  ...
)

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; if terms, returns words sorted by the polarity scores in descending order; if predict, returns the polarity scores of documents.

remove

if TRUE, remove each seed word when what = "seeds".

from, to, by

passed to seq() to generate values for k; only used when what = "k".

verbose

show messages if TRUE.

...

additional arguments passed to as.textmodel_lss() and predict().

Details

This function internally creates LSS fitted textmodel_lss objects 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".


koheiw/LSS documentation built on March 9, 2024, 4:41 a.m.