Skip to contents

Model-based recursive partitioning algorithm. Calls partykit::mob() from mob.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.mob")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”, “se”

  • Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”

  • Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin

Parameters

IdTypeDefaultLevelsRange
rhsuntyped--
fituntyped--
offsetuntyped--
clusteruntyped--
alphanumeric0.05\([0, 1]\)
bonferronilogicalTRUETRUE, FALSE-
minsizeinteger-\([1, \infty)\)
minsplitinteger-\([1, \infty)\)
minbucketinteger-\([1, \infty)\)
maxdepthintegerInf\([0, \infty)\)
mtryintegerInf\([0, \infty)\)
trimnumeric0.1\([0, \infty)\)
breaktieslogicalFALSETRUE, FALSE-
parmuntyped--
dfsplitinteger-\([0, \infty)\)
pruneuntyped--
restartlogicalTRUETRUE, FALSE-
verboselogicalFALSETRUE, FALSE-
caseweightslogicalTRUETRUE, FALSE-
ytypecharactervectorvector, matrix, data.frame-
xtypecharactermatrixvector, matrix, data.frame-
terminaluntyped"object"-
inneruntyped"object"-
modellogicalTRUETRUE, FALSE-
numsplitcharacterleftleft, center-
catsplitcharacterbinarybinary, multiway-
vcovcharacteropgopg, info, sandwich-
ordinalcharacterchisqchisq, max, L2-
nrepinteger10000\([0, \infty)\)
applyfununtyped--
coresintegerNULL\((-\infty, \infty)\)
additionaluntyped--
predict_fununtyped--

References

Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.

Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933 , https://doi.org/10.1198/106186006x133933.

See also

Author

sumny

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrMob

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

LearnerRegrMob$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

library(mlr3)
lm_ = function(y, x, start = NULL, weights = NULL, offset = NULL, ...) {
  lm(y ~ 1, ...)
}
learner = LearnerRegrMob$new()
learner$param_set$values$rhs = "."
learner$param_set$values$fit = lm_
learner$feature_types = c("logical", "integer", "numeric", "factor", "ordered")

predict_fun = function(object, newdata, task, .type) {
  preds = predict(object, newdata = newdata, type = "response", se.fit = TRUE)
  cbind(preds$fit, preds$se.fit)
}
learner$param_set$values$predict_fun = predict_fun
task = tsk("mtcars")
ids = partition(task)
learner$train(task, row_ids = ids$train)
learner$predict(task, row_ids = ids$test)
#> <PredictionRegr> for 11 observations:
#>  row_ids truth response
#>        2  21.0 20.03333
#>        4  21.4 20.03333
#>        5  18.7 20.03333
#>      ---   ---      ---
#>       25  19.2 20.03333
#>       27  26.0 20.03333
#>       30  19.7 20.03333