Learn R Programming

sentometrics (version 0.2)

predict.sentomodel: Make predictions from a sentomodel object

Description

Prediction method for sentomodel class, with usage along the lines of predict.glmnet, but simplified in terms of allowed parameters.

Usage

# S3 method for sentomodel
predict(object, newx, type, offset = NULL, ...)

Arguments

object

a sentomodel object created with sento_model.

newx

a matrix of numeric values with all explanatory variables to be used for the prediction(s), structured row-by-row; see documentation for predict.glmnet. The number of variables should be equal to sentomodel$nVar, being the sum of the number of original sentiment measures and the number of additional explanatory variables. Variables discarded in the regression process are discarded again here, based on sentomodel$discarded.

type

type of prediction required, a value from c("link", "response", "class"), see documentation for predict.glmnet.

offset

not used. Any values here will be ignored.

...

not used.

Value

A prediction output depending on the type argument.

See Also

predict.glmnet, sento_model