View source: R/counterfactual_model.R
run_rf | R Documentation |
This function trains a random forest model (ranger) on the specified training dataset and makes predictions on the test dataset in a counterfactual scenario. The model uses meteorological variables and temporal features.
run_rf(train, test, model_params, alpha, calc_shaps)
train |
Dataframe of train data as returned by the |
test |
Dataframe of test data as returned by the |
model_params |
list of hyperparameters to use in ranger call. See |
alpha |
Confidence level of the prediction interval between 0 and 1. |
calc_shaps |
Boolean value. If TRUE, calculate SHAP values for the
method used and format them so they can be visualised with |
Note: Runs the random forest model for individualised use with own data pipeline.
Otherwise use run_counterfactual()
to call this function.
List with data frame of predictions and model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.