mlr_learners_regr.earth: Implementation of Multivariate Adaptive Regression Splines

mlr_learners_regr.earthR Documentation

Implementation of Multivariate Adaptive Regression Splines

Description

This is an alternative implementation of MARS (Multivariate Adaptive Regression Splines). MARS is trademarked and thus not used as the name. The name "earth" stands for "Enhanced Adaptive Regression Through Hinges".

Calls earth::earth() from earth.

Details

Methods for variance estimations are not yet implemented.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.earth")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”, “se”

  • Feature Types: “integer”, “numeric”, “factor”

  • Required Packages: mlr3, mlr3extralearners, earth

Parameters

Id Type Default Levels Range
wp untyped NULL -
offset untyped NULL -
keepxy logical FALSE TRUE, FALSE -
trace character 0 0, .3, .5, 1, 2, 3, 4, 5 -
degree integer 1 [1, \infty)
penalty numeric 2 [-1, \infty)
nk untyped NULL -
thresh numeric 0.001 (-\infty, \infty)
minspan numeric 0 [0, \infty)
endspan numeric 0 [0, \infty)
newvar.penalty numeric 0 [0, \infty)
fast.k integer 20 [0, \infty)
fast.beta integer 1 [0, 1]
linpreds untyped FALSE -
allowed untyped - -
pmethod character backward backward, none, exhaustive, forward, seqrep, cv -
nprune integer - [0, \infty)
nfold integer 0 [0, \infty)
ncross integer 1 [0, \infty)
stratify logical TRUE TRUE, FALSE -
varmod.method character none none, const, lm, rlm, earth, gam, power, power0, x.lm, x.rlm, ... -
varmod.exponent numeric 1 (-\infty, \infty)
varmod.conv numeric 1 [0, 1]
varmod.clamp numeric 0.1 (-\infty, \infty)
varmod.minspan numeric -3 (-\infty, \infty)
Scale.y logical FALSE TRUE, FALSE -
Adjust.endspan numeric 2 (-\infty, \infty)
Auto.linpreds logical TRUE TRUE, FALSE -
Force.weights logical FALSE TRUE, FALSE -
Use.beta.cache logical TRUE TRUE, FALSE -
Force.xtx.prune logical FALSE TRUE, FALSE -
Get.leverages logical TRUE TRUE, FALSE -
Exhaustive.tol numeric 1e-10 (-\infty, \infty)

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrEarth

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
LearnerRegrEarth$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
LearnerRegrEarth$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

pkopper

References

Milborrow, Stephen, Hastie, T, Tibshirani, R (2014). “Earth: multivariate adaptive regression spline models.” R package version, 3(7).

Friedman, H J (1991). “Multivariate adaptive regression splines.” The annals of statistics, 19(1), 1–67.

See Also

Examples


# Define the Learner
learner = mlr3::lrn("regr.earth")
print(learner)

# Define a Task
task = mlr3::tsk("mtcars")

# Create train and test set
ids = mlr3::partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()


mlr-org/mlr3extralearners documentation built on Dec. 21, 2024, 2:21 p.m.