Cross-validated lasso (glmnet) of an outcome on the topic-proportion matrix
(cf. stm::topicLasso). Identifies which topics predict the outcome.
Arguments
- formula
outcome ~ .— the LHS names the outcome indata.- model
A faSTM fit (supplies the topic proportions).
- data
Document-level data with the outcome, aligned to the documents.
- family
glmnet family (
"gaussian","binomial", ...).- nfolds
CV folds.
- seed
RNG seed.
- ...
Passed to
glmnet::cv.glmnet().