Skip to contents

Computes the out-of-bag (OOB) predictions for the training data. This gives a good sense of out-of-sample performance in the future.

Usage

YARF_update_with_oob_results(
  yarf_mod,
  oob_cost_calculation_script = NULL,
  indices = NULL
)

Arguments

yarf_mod

The yarf model object

oob_cost_calculation_script

An optional custom Javascript function which calculates the cost of a prediction given the true value of the prediction (see below). If is likely similar to cost_single_node_calc_script. It is recommended to share code between them by writing a function included in shared_scripts which is passed into YARF upon construction and can be referenced when calculating OOB results.

function oobCost(y_hat, y){ //y_hat is the predicted value and y is the true value (both are of type double)

...

return double //where a larger number indicates a higher cost to the error between y and y_hat.

}

indices

The indices to compute OOB performance. This is generally a private argument for use by the validation / test functions.

Author

Adam Kapelner