f_rf_rsquared {collinear} | R Documentation |
R-squared of Random Forest model
Description
Computes a univariate random forest model with \link[ranger]{ranger}
and returns the R-squared on the out-of-bag data.
Usage
f_rf_rsquared(x, y, df)
f_rf_deviance(x, y, df)
Arguments
x |
(required, character string) name of the predictor variable. |
y |
(required, character string) name of the response variable |
df |
(required, data frame) data frame with the columns 'x' and 'y'. |
Details
f_rf_rsquared()
and f_rf_deviance()
are synonyms
Value
R-squared
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_rsquared(
x = "growing_season_length", #predictor
y = "vi_mean", #response
df = vi
)
}
[Package collinear version 1.1.1 Index]