AUC of Random Forest model of an unbalanced binary response
f_rf_auc_unbalanced.Rd
Computes a univariate random forest model with weighted cases via \link[ranger]{ranger}
and returns the Area Under the Curve on the out-of-bag data.
Arguments
- x
(required, character string) name of the predictor variable.
- y
(required, character string) name of the binary response variable
- df
(required, data frame) data frame with the columns 'x' and 'y'.
Examples
data(vi)
#subset to limit example run time
vi <- vi[1:1000, ]
#this example requires "ranger" installed in the system
if(requireNamespace(package = "ranger", quietly = TRUE)){
f_rf_auc_unbalanced(
x = "growing_season_length", #predictor
y = "vi_binary", #response
df = vi
)
}
#> [1] 0.9158895