mlr_learners_regr.mob: Regression Model-based Recursive Partitioning Learner

mlr_learners_regr.mobR Documentation

Regression Model-based Recursive Partitioning Learner

Description

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

Id Type Default Levels Range
rhs untyped - -
fit untyped - -
offset untyped - -
cluster untyped - -
alpha numeric 0.05 [0, 1]
bonferroni logical TRUE TRUE, FALSE -
minsize integer - [1, \infty)
minsplit integer - [1, \infty)
minbucket integer - [1, \infty)
maxdepth integer Inf [0, \infty)
mtry integer Inf [0, \infty)
trim numeric 0.1 [0, \infty)
breakties logical FALSE TRUE, FALSE -
parm untyped - -
dfsplit integer - [0, \infty)
prune untyped - -
restart logical TRUE TRUE, FALSE -
verbose logical FALSE TRUE, FALSE -
caseweights logical TRUE TRUE, FALSE -
ytype character vector vector, matrix, data.frame -
xtype character matrix vector, matrix, data.frame -
terminal untyped "object" -
inner untyped "object" -
model logical TRUE TRUE, FALSE -
numsplit character left left, center -
catsplit character binary binary, multiway -
vcov character opg opg, info, sandwich -
ordinal character chisq chisq, max, L2 -
nrep integer 10000 [0, \infty)
applyfun untyped - -
cores integer NULL (-\infty, \infty)
additional untyped - -
predict_fun untyped - -

Super classes

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

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
LearnerRegrMob$new()

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.

Author(s)

sumny

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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/106186006x133933")}, https://doi.org/10.1198/106186006x133933.

See Also

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)


mlr-org/mlr3extralearners documentation built on Nov. 11, 2024, 11:11 a.m.