yhat: Wrapper over the predict function

Description Usage Arguments Details Value

Description

This function is just a wrapper over the predict function. It sets different default parameters for models from different classes. For example: for classification random Forest is forces the output to be probabilities not classes itself.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
yhat(X.model, newdata, ...)

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

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

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

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

## Default S3 method:
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

Details

We use the 'yhat' name instead of 'predict' since we need different defaults that the one set in the 'predict' function.

Value

An numeric matrix of predictions. Can have more than one collumn.


pbiecek/DALEX2 documentation built on May 3, 2019, 5:48 p.m.