Skip to contents

This is an alternative implementation of MARS (Multivariate Adaptive Regression Splines). The classification problem is solved by 0-1 encoding of the two-class targets and setting the decision threshold to p = 0.5 during the prediction phase. MARS is trademarked and thus not used as the name. The name "earth" stands for "Enhanced Adaptive Regression Through Hinges".

Details

Methods for variance estimations are not yet implemented.

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.earth")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

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

  • Required Packages: mlr3, mlr3extralearners, earth

Parameters

IdTypeDefaultLevelsRange
wpuntypedNULL-
offsetuntypedNULL-
keepxylogicalFALSETRUE, FALSE-
tracecharacter00, .3, .5, 1, 2, 3, 4, 5-
degreeinteger1\([1, \infty)\)
penaltynumeric2\([-1, \infty)\)
nkuntypedNULL-
threshnumeric0.001\((-\infty, \infty)\)
minspannumeric0\([0, \infty)\)
endspannumeric0\([0, \infty)\)
newvar.penaltynumeric0\([0, \infty)\)
fast.kinteger20\([0, \infty)\)
fast.betainteger1\([0, 1]\)
linpredsuntypedFALSE-
alloweduntyped--
pmethodcharacterbackwardbackward, none, exhaustive, forward, seqrep, cv-
npruneinteger-\([0, \infty)\)
nfoldinteger0\([0, \infty)\)
ncrossinteger1\([0, \infty)\)
stratifylogicalTRUETRUE, FALSE-
varmod.methodcharacternonenone, const, lm, rlm, earth, gam, power, power0, x.lm, x.rlm, ...-
varmod.exponentnumeric1\((-\infty, \infty)\)
varmod.convnumeric1\([0, 1]\)
varmod.clampnumeric0.1\((-\infty, \infty)\)
varmod.minspannumeric-3\((-\infty, \infty)\)
Scale.ylogicalFALSETRUE, FALSE-
Adjust.endspannumeric2\((-\infty, \infty)\)
Auto.linpredslogicalTRUETRUE, FALSE-
Force.weightslogicalFALSETRUE, FALSE-
Use.beta.cachelogicalTRUETRUE, FALSE-
Force.xtx.prunelogicalFALSETRUE, FALSE-
Get.leverageslogicalTRUETRUE, FALSE-
Exhaustive.tolnumeric1e-10\((-\infty, \infty)\)

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

Author

pkopper

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifEarth

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifEarth$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = mlr3::lrn("classif.earth")
print(learner)
#> <LearnerClassifEarth:classif.earth>: Multivariate Adaptive Splines
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3extralearners, earth
#> * Predict Types:  [response], prob
#> * Feature Types: integer, numeric, factor
#> * Properties: twoclass, weights

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

# 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)
#> GLM (family binomial, link logit):
#>  nulldev  df       dev  df   devratio     AIC iters converged
#>  192.515 138   49.4911 127      0.743   73.49     8         1
#> 
#> Earth selected 12 of 22 terms, and 9 of 60 predictors
#> Termination condition: RSq changed by less than 0.001 at 22 terms
#> Importance: V11, V36, V45, V17, V4, V28, V60, V46, V23, V1-unused, ...
#> Number of terms at each degree of interaction: 1 11 (additive model)
#> Earth GCV 0.1228887    RSS 11.89634    GRSq 0.5148646    RSq 0.6572158


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

# Score the predictions
predictions$score()
#> classif.ce 
#>  0.2028986