ensemble: This function implements an ensemble learner with the...

View source: R/ensemble.R

ensembleR Documentation

This function implements an ensemble learner with the possibility to extract the smoother matrix of linear smoothers.

Description

This function implements an ensemble learner with the possibility to extract the smoother matrix of linear smoothers.

Usage

ensemble(ml, x, y, xnew, nfolds = 5, weights = FALSE, quiet = TRUE)

Arguments

ml

List of methods build via create_method to be used in ensemble.

x

Covariate matrix of training sample.

y

Vector of outcomes of training sample.

xnew

Covariate matrix of test sample.

nfolds

Number of folds used in cross-validation of ensemble weights (default nfolds=5).

weights

If TRUE, weights underlying the ensemble prediction for xnew calculated.

quiet

If FALSE, print method that is currently computed.

Value

Ensemble object containing:

ensemble

the predictions of the trained ensemble for the test sample

best

the predictions of the best performing single method for the test sample

fit_full

matrix containing predictions of all considered methods

weights

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

nnls_weights

the weights that each method receives in the ensemble

mse_cv

cross-validated MSEs for each method

fit_cv

matrix containing the cross-validated predictions for each method

@export


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