Learn R Programming

Causata (version 4.1-0)

predict.GlmnetModelDefinition: Generate predictions for a glmnet model.

Description

Generate predictions for a glmnet model.

Usage

## S3 method for class 'GlmnetModelDefinition':
predict(object, data, verbose = FALSE, \dots)

Arguments

object
An object from ModelDefinition.
data
A dataframe that will be used to generate predictions.
verbose
If TRUE then prediction information will be printed to the console.
...
Extra unused arguments.

Value

  • A list is returned with elements as follows:
  • model.matrixThe model matrix used to calculate predicted values.
  • predictedPredicted values.
  • lambdaThe lambda value used by glmnet.

Details

This function generates predictions using the data provided. If columns in the model matrix are missing then columns of zeros will be inserted and a warning will be generated. Typically transformations are applied using GetTransforms before predict is applied.

See Also

ModelDefinition, glmnet, model.matrix, glmnet, GetTransforms.