Skip to contents

Compute predicted values from a fitted explainable boosting machine.

Usage

# S3 method for EBM
predict(
  object,
  newdata,
  type = c("response", "link", "class", "terms"),
  se_fit = FALSE,
  init_score = NULL,
  ...
)

Arguments

object

A fitted ebm object.

newdata

A data frame in which to look for variables with which to predict.

type

The type of prediction required. Current options include:

  • "response": Returns predictions on the scale of the response variable. Thus, for a categorical outcome (i.e., binary or multiclass), a matrix of predicted probabilities is returned.

  • "link": Returns predictions on the link scale. For a binary outcome with logit link, for example, this results in a vector of logits. For a multiclass outcome, this will return a matrix with one column for each class. Ignored for regression problems.

  • "class": Returns a vector predicted class label for categorical outcomes.

  • "terms": Returns a matrix (or list of matrices for multiclass outcomes) of the individual term contributions (e.g., the f(x)'s). Note that term contributions are on the link scale, where they are additive.

se_fit

Logical indicating whether or not standard errors are required. Ignored for multiclass outcomes. Note that standard errors are only available on the link scale.

init_score

Optional. Either a model that can generate scores or per-sample initialization score. If samples scores it should be the same length as newdata.

...

Additional optional arguments. (Currently ignored.)

Value

Either a vector, matrix, or list of result. See the type argument for details.