Skip to contents

A multistep model's per-step outcome columns (e.g. lead_2_value) are engineered by step_lead() from a single raw column, so they are not present in a user's raw data the way genuine multi-output columns are. This re-bakes the fitted recipe on new_data to recover the actual future value at kerasnip_step_view()'s step, for calibration/interval use. Rows too close to the end of new_data for the lead to be computed return NA (dropped automatically by calibration routines that call sort()/stats::complete.cases() on the result).

Usage

kerasnip_step_truth(view, new_data)

Arguments

view

A kerasnip_step_view.

new_data

A data frame of raw predictors (and the original outcome column step_lead() was applied to).

Value

A numeric vector, one truth value per row of new_data.