DALEX (version 0.4.4)

yhat: Wrapper over the predict function

Description

This function is a wrapper over the predict function. The wrapper returns a single numeric score for each new observation. To do this it uses different extraction techniques for models from different classes, like for classification random forest is forces the output to be probabilities not classes itself.

Usage

yhat(X.model, newdata, ...)

# S3 method for lm yhat(X.model, newdata, ...)

# S3 method for randomForest yhat(X.model, newdata, ...)

# S3 method for svm yhat(X.model, newdata, ...)

# S3 method for glm yhat(X.model, newdata, ...)

# S3 method for cv.glmnet yhat(X.model, newdata, ...)

# S3 method for glmnet yhat(X.model, newdata, ...)

# S3 method for ranger yhat(X.model, newdata, ...)

# S3 method for WrappedModel yhat(X.model, newdata, ...)

# S3 method for model_fit yhat(X.model, newdata, ...)

# S3 method for train yhat(X.model, newdata, ...)

# S3 method for default yhat(X.model, newdata, ...)

# S3 method for H2ORegressionModel yhat(X.model, newdata, ...)

# S3 method for H2OBinomialModel yhat(X.model, newdata, ...)

Arguments

X.model

object - a model to be explained

newdata

data.frame or matrix - observations for prediction

...

other parameters that will be passed to the predict function

Value

An numeric matrix of predictions

Details

Currently supported packages are:

  • class `cv.glmnet` and `glmnet` - models created with `glmnet` package

  • class `glm` - generalized linear models

  • class `H2OBinomialModel` and `H2ORegressionModel` - models created with `h2o` package

  • class `model_fit` - models created with `parsnip` package

  • class `lm` - linear models created with `stats::lm`

  • class `ranger` - models created with `ranger` package

  • class `randomForest` - random forest models created with `randomForest` package

  • class `svm` - support vector machines models created with the `e1071` package

  • class `train` - models created with `caret` package

  • class `WrappedModel` - models created with `mlr` package