Skip to contents

This function adds back the target values in the test set using a reference table.

Usage

add_target_back_to_test_set_from_ref_table(tt, ref_table)

Arguments

tt

train-test list (see ttsplit())

ref_table

reference table (see Details)

Value

tt with target replaced with original values in $test

Details

The reference table is a data.frame initially created by remove_target_from_test_and_add_ref_to_env().

Note

This function implements the method described in Preventing Target Leakage (D22 QuantCafé, 2021).

Examples

if (FALSE) {
tt <- tt |> add_target_back_to_test_set_from_ref_table(target_values)
}