rmw_predict_the_test_set {rmweather} | R Documentation |
Functions to use a model to predict the observations within a test set after
rmw_calculate_model
.
Description
rmw_predict_the_test_set
uses data withheld from the training of the
model and therefore can be used for investigating overfitting.
Usage
rmw_predict_the_test_set(model, df)
Arguments
model |
A ranger model object from |
df |
Input data used to calculate |
Value
Tibble.
Author(s)
Stuart K. Grange
Examples
# Load package
library(dplyr)
# Prepare example data
data_london_prepared <- data_london %>%
filter(variable == "no2") %>%
rmw_prepare_data()
# Use the test set for prediction
rmw_predict_the_test_set(
model_london,
df = data_london_prepared
)
# Predict, then produce a hex plot of the predictions
rmw_predict_the_test_set(
model_london,
df = data_london_prepared
) %>%
rmw_plot_test_prediction()
[Package rmweather version 0.2.6 Index]