A wrapper for ranger::ranger() for use in nadir::super_learner().
Arguments
- data
A dataframe to train a learner / learners on.
- formula
A regression formula to use inside this learner.
- weights
Observation weights; see
?lm- ...
Any extra arguments that should be passed to the internal model for model fitting purposes.
Value
A prediction function that accepts newdata,
which returns predictions (a numeric vector of values, one for each row
of newdata).
Examples
lnr_ranger(mtcars, mpg ~ hp)(mtcars)
#> [1] 21.15798 21.15798 23.56031 21.15798 18.56013 20.06867 14.08386 28.77061
#> [9] 22.56904 19.42427 19.42427 16.57948 16.57948 16.57948 11.83021 11.59088
#> [17] 13.59780 29.65681 29.16197 30.45365 21.68659 16.55865 16.55865 14.08386
#> [25] 18.56013 29.65681 25.30832 26.71345 14.54609 18.56013 14.60398 21.08891
