R/utils.R
clear_outcome.Rd
Partially clear outcome variable in new data by overriding with NA values
clear_outcome(data, index, outcome, timesteps, key = NULL)
(data.frame
) New data
Date variable
Outcome (target) variable
(integer
) Number of timesteps used by RNN model
A key (id) to group the data.frame (for panel data)
tarnow_temp <-
weather_pl %>%
filter(station == "TRN") %>%
select(date, tmax_daily, tmin_daily, press_mean_daily)
TIMESTEPS <- 20
HORIZON <- 1
data_split <-
time_series_split(
tarnow_temp, date,
initial = "18 years",
assess = "2 years",
lag = TIMESTEPS
)
#> Error in time_series_split(tarnow_temp, date, initial = "18 years", assess = "2 years", lag = TIMESTEPS): could not find function "time_series_split"
cleared_new_data <-
testing(data_split) %>%
clear_outcome(date, tmax_daily, TIMESTEPS)
#> Error in assessment(x): object 'data_split' not found
head(cleared_new_data, TIMESTEPS + 10)
#> Error in head(cleared_new_data, TIMESTEPS + 10): object 'cleared_new_data' not found