mlr_learners_avg
Optimized Weighted Average of Features for Classification and Regression
Computes a weighted average of inputs. Used in the context of computing weighted averages of predictions.
Predictions are averaged using weights
(in order of appearance in the data) which are optimized using
nonlinear optimization from the package "nloptr" for a measure provided in measure
(defaults to classif.acc
for LearnerClassifAvg
and regr.mse
for LearnerRegrAvg
).
Learned weights can be obtained from $model
.
Using non-linear optimization is implemented in the SuperLearner R package.
For a more detailed analysis the reader is referred to LeDell (2015).
Note, that weights always sum to 1 by dividing through sum(weights) before weighting incoming features.
Usage
mlr_learners_classif.avgmlr_learners_regr.avg
Format
R6Class
object inheriting from mlr3::LearnerClassif
/mlr3::Learner
.
Parameters
The parameters are the parameters inherited from LearnerClassif
, as well as:
measure
::Measure
|character
Measure
to optimize for. Will be converted to aMeasure
in case it ischaracter
. Initialized to"classif.ce"
, i.e. misclassification error for classification and"regr.mse"
, i.e. mean squared error for regression.optimizer
::Optimizer
|character(1)
Optimizer
used to find optimal thresholds. Ifcharacter
, converts toOptimizer
viaopt
. Initialized toOptimizerNLoptr
. Nloptr hyperparameters are initialized toxtol_rel = 1e-8
,algorithm = "NLOPT_LN_COBYLA"
and equal initial weights for each learner. For more fine-grained control, it is recommended to supply a instantiatedOptimizer
.log_level
::character(1)
|integer(1)
Set a temporary log-level forlgr::get_logger("bbotk")
. Initialized to: "warn".
Methods
LearnerClassifAvg$new(), id = "classif.avg")
(chr
) ->self
Constructor.LearnerRegrAvg$new(), id = "regr.avg")
(chr
) ->self
Constructor.
References
mlr3pipelinesledell_2015
See Also
Other Learners:
mlr_learners_graph
Other Ensembles:
PipeOpEnsemble
,
mlr_pipeops_classifavg
,
mlr_pipeops_ovrunite
,
mlr_pipeops_regravg