Estimate Regression distr Predict Type Pipeline
Source:R/pipelines.R
mlr_graphs_probregrcompositor.Rd
Wrapper around PipeOpProbregrCompositor to simplify Graph creation.
Usage
pipeline_probregrcompositor(
learner,
learner_se = NULL,
dist = "Normal",
graph_learner = FALSE
)
Arguments
- learner
[mlr3::Learner]|[mlr3pipelines::PipeOp]|[mlr3pipelines::Graph]
Either aLearner
which will be wrapped in mlr3pipelines::PipeOpLearner, aPipeOp
which will be wrapped in mlr3pipelines::Graph or aGraph
itself. UnderlyingLearner
should be LearnerRegr.- learner_se
[mlr3::Learner]|[mlr3pipelines::PipeOp]
Optional LearnerRegr with predict_typese
to estimate the standard error. If leftNULL
thenlearner
must havese
in predict_types.- dist
character(1)
Location-scale distribution to use for composition. Current possibilities are'"Cauchy", "Gumbel", "Laplace", "Logistic", "Normal
(default).- graph_learner
logical(1)
IfTRUE
returns wraps the Graph as a GraphLearner otherwise (default) returns as aGraph
.
Examples
if (FALSE) {
if (requireNamespace("mlr3pipelines", quietly = TRUE) &&
requireNamespace("rpart", quietly = TRUE)) {
library("mlr3")
library("mlr3pipelines")
task = tsk("boston_housing")
# method 1 - one learner for response and se
pipe = ppl(
"probregrcompositor",
learner = lrn("regr.featureless", predict_type = "se"),
dist = "Normal"
)
pipe$train(task)
pipe$predict(task)
# method 2 - one learner for response and one for se
pipe = ppl(
"probregrcompositor",
learner = lrn("regr.rpart"),
learner_se = lrn("regr.featureless", predict_type = "se"),
dist = "Logistic"
)
pipe$train(task)
pipe$predict(task)
}
}