mlr_graphs_probregr: Estimate Regression distr Predict Type Pipeline

mlr_graphs_probregrR Documentation

Estimate Regression distr Predict Type Pipeline

Description

Wrapper around PipeOpProbregr to simplify Graph creation.

[Experimental]

Usage

pipeline_probregr(
  learner,
  learner_se = NULL,
  dist = "Uniform",
  graph_learner = FALSE
)

Arguments

learner

⁠[mlr3::Learner]|[mlr3pipelines::PipeOp]|[mlr3pipelines::Graph]⁠
Either a Learner which will be wrapped in mlr3pipelines::PipeOpLearner, a PipeOp which will be wrapped in mlr3pipelines::Graph or a Graph itself. Underlying Learner should be LearnerRegr.

learner_se

⁠[mlr3::Learner]|[mlr3pipelines::PipeOp]⁠
Optional LearnerRegr with predict_type se to estimate the standard error. If left NULL then learner must have se in predict_types.

dist

(character(1))
Location-scale distribution to use for composition. Current possibilities are' ⁠"Cauchy", "Gumbel", "Laplace", "Logistic", "Normal", "Uniform"⁠. Default is "Uniform".

graph_learner

(logical(1))
If TRUE returns wraps the Graph as a GraphLearner otherwise (default) returns as a Graph.

Value

mlr3pipelines::Graph or mlr3pipelines::GraphLearner

Dictionary

This Graph can be instantiated via the dictionary mlr_graphs or with the associated sugar function ppl():

mlr_graphs$get("probregr")
ppl("probregr")

See Also

Other pipelines: mlr_graphs_crankcompositor, mlr_graphs_distrcompositor, mlr_graphs_responsecompositor, mlr_graphs_survaverager, mlr_graphs_survbagging, mlr_graphs_survtoclassif_IPCW, mlr_graphs_survtoclassif_disctime, mlr_graphs_survtoregr_pem

Examples


## Not run: 
  library(mlr3)
  library(mlr3pipelines)

  task = tsk("boston_housing")

  # method 1 - same learner for response and se
  pipe = ppl(
    "probregr",
    learner = lrn("regr.featureless", predict_type = "se"),
    dist = "Uniform"
  )
  pipe$train(task)
  pipe$predict(task)

  # method 2 - different learners for response and se
  pipe = ppl(
    "probregr",
    learner = lrn("regr.rpart"),
    learner_se = lrn("regr.featureless", predict_type = "se"),
    dist = "Normal"
  )
  pipe$train(task)
  pipe$predict(task)

## End(Not run)


mlr-org/mlr3proba documentation built on April 12, 2025, 4:38 p.m.