predict.mean_fit: Predicts arithmetic mean and provides prediction weights if...

View source: R/ml_wrapper.R

predict.mean_fitR Documentation

Predicts arithmetic mean and provides prediction weights if required.

Description

Predicts arithmetic mean and provides prediction weights if required.

Usage

## S3 method for class 'mean_fit'
predict(mean_fit, x, y, xnew = NULL, weights = FALSE)

Arguments

mean_fit

Output of mean_fit

x

Covariate matrix of training sample

y

Vector of outcomes of training sample

xnew

Covariate matrix of test sample

weights

If TRUE, weights underlying the prediction for xnew calculated

Value

Returns list containing:

prediction

vector of predictions for xnew

weights

If weights=TRUE prediction weights of dimension nrow(xnew) x nrow(x) containing the weights that deliver predictions where each row gives the weight that each training outcome received in the prediction for xnew.


MCKnaus/causalDML documentation built on Aug. 19, 2023, 5:47 p.m.