rescale_predictions {ubair} | R Documentation |
Rescale predictions to original scale.
Description
This function rescales the predicted values (prediction
, prediction_lower
,
prediction_upper
). The scaling is reversed using the means and
standard deviations that were saved from the training data. It is the inverse
function to scale_data()
and should be used only in combination.
Usage
rescale_predictions(scale_result, dt_predictions)
Arguments
scale_result |
A list object returned by |
dt_predictions |
A data frame containing the predictions,
including columns |
Value
A data frame with the predictions and numeric columns rescaled back to their original scale.
Examples
data(mock_env_data)
scale_res <- scale_data(
train_data = mock_env_data[1:80, ],
apply_data = mock_env_data[81:100, ]
)
params <- load_params()
res <- run_lightgbm(
train = scale_res$train, test = scale_res$apply,
params$lightgbm, alpha = 0.9, calc_shaps = FALSE
)
dt_predictions <- res$dt_predictions
rescaled_predictions <- rescale_predictions(scale_res, dt_predictions)
[Package ubair version 1.1.0 Index]