Learn R Programming

textreg (version 0.1.5)

find.CV.C: K-fold cross-validation to determine optimal tuning parameter

Description

Given a corpus, divide into K-folds and do test-train spilts averaged over the folds.

Usage

find.CV.C(corpus, labeling, banned, K = 5, length.out = 10,
  max_C = NULL, verbose = FALSE, ...)

Arguments

corpus

The text

labeling

The labeling

banned

The words to drop.

K

Number of folds for K-fold cross-validation

length.out

number of values of C to examine from 0 to max_C.

max_C

upper bound for tuning parameter; if NULL, sets max_C to threshold C

verbose

Print progress

...

parameters to be passed to the original textreg() function

Value

a dataframe containing the mean/standard error of out-of-sample predictions under K-Fold Cross-validation

Details

Increments tuning parameter, performs K-fold cross-validation on each C giving a profile of predictive power for different C.

See Also

make.CV.chart