Skip to contents

A wrapper for earth::earth() for use in nadir::super_learner().

Usage

lnr_earth(data, formula, weights = NULL, ...)

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).

See also

learners

Examples

lnr_earth(mtcars, mpg ~ hp + disp + am + wt)(mtcars)
#>  [1] 21.53404 20.48176 24.98489 20.36920 16.63860 20.15230 16.31341 24.23305
#>  [9] 21.66967 18.77684 18.77684 15.06266 15.91317 15.78809 12.11089 11.67563
#> [17] 11.87325 27.96494 33.17753 30.60467 23.65091 16.43848 16.65111 15.63800
#> [25] 15.62549 29.82396 26.40600 29.06224 17.31400 17.31400 16.31341 20.56096