Learn R Programming

sentometrics (version 0.5.6)

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 parameters.

Usage

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

Arguments

object

a sentomodel object created with sento_model.

newx

a data matrix used for the prediction(s), row-by-row; see predict.glmnet. The number of columns should be equal to sum(sentomodel$nVar), being the number of original sentiment measures and other variables. The variables discarded in the regression process are dealt with within this function, based on sentomodel$discarded.

type

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

offset

not used.

...

not used.

Value

A prediction output depending on the type argument.

See Also

predict.glmnet, sento_model