Skip to contents

Construct a nested_fit object that holds the early and late model plus their hyperparameters.

Usage

nested_fit(model1, model2, error_grid, best_hyperparams)

Arguments

model1

An S3 object with a predict method. The early model.

model2

An S3 object with a predict method. The late model.

error_grid

named numeric matrix. Entry (i, j) is the validated metric of the nested model with the early model having the i-th and the late model having the j-th of their respective hyperparameters (which are given as dimnames).

best_hyperparams

A named list with the best hyperparameters.

Value

An S3 object with class `nested_fit'.

Details

Nest two models. The first model takes part of the features (those not matching pattern) to make a prediction that we in turn feed together with the rest of the features to the second model. This gives us a final prediction. Both models must be S3 objects with a predict method.