caretPredict: Prediction wrapper for 'train'

View source: R/caretPredict.R

caretPredictR Documentation

Prediction wrapper for train

Description

This is a prediction wrapper for train with several features: - If newdata is null, return stacked predictions from the training job, rather than in-sample predictions. - Always returns probabilities for classification models. - Optionally drops one predicted class for classification models. - Always returns a data.table

Usage

caretPredict(
  object,
  newdata = NULL,
  excluded_class_id = 1L,
  aggregate_resamples = TRUE,
  ...
)

Arguments

object

a train object

newdata

New data to use for predictions. If NULL, stacked predictions from the training data are returned.

excluded_class_id

an integer indicating the class to exclude. If 0L, no class is excluded

aggregate_resamples

logical, whether to aggregate resamples by keys. Default is TRUE.

...

additional arguments to pass to predict.train, if newdata is not NULL

Value

a data.table


zachmayer/caretEnsemble documentation built on Dec. 19, 2024, 5:17 p.m.