| LearnerRpart | R Documentation |
This learner is a wrapper around rpart::rpart() in order to fit recursive
partitioning and regression trees.
Optimization metric:
classification (method = "class"): classification error rate
regression (method = "anova"): mean squared error
Can be used with
MLTuneParameters
MLCrossValidation
MLNestedCV
Implemented methods:
$fit To fit the model.
$predict To predict new data with the model.
$cross_validation To perform a grid search (hyperparameter
optimization).
$bayesian_scoring_function To perform a Bayesian hyperparameter
optimization.
Parameters that are specified with parameter_grid and / or learner_args
are forwarded to rpart's argument control (see
rpart::rpart.control() for further details).
For the two hyperparameter optimization strategies ("grid" and "bayesian"),
the parameter metric_optimization_higher_better of the learner is
set to FALSE by default as the mean misclassification error rate
(measures::MMCE()) is used as the optimization metric for
classification tasks and the mean squared error (measures::MSE()) is
used for regression tasks.
mlexperiments::MLLearnerBase -> LearnerRpart
new()Create a new LearnerRpart object.
LearnerRpart$new()
This learner is a wrapper around rpart::rpart() in order to fit
recursive partitioning and regression trees. The following experiments
are implemented:
MLTuneParameters
MLCrossValidation
MLNestedCV
For the two hyperparameter optimization strategies ("grid" and
"bayesian"), the parameter metric_optimization_higher_better of the
learner is set to FALSE by default as the mean misclassification
error (measures::MMCE()) is used as the optimization metric for
classification tasks and the mean squared error (measures::MSE())
is used for regression tasks.
if (requireNamespace("rpart", quietly = TRUE)) {
LearnerRpart$new()
}
clone()The objects of this class are cloneable with this method.
LearnerRpart$clone(deep = FALSE)
deepWhether to make a deep clone.
rpart::rpart(), measures::MMCE(), [measures::MSE)],
[rpart::rpart.control()]
[measures::MSE)]: R:measures::MSE) [rpart::rpart.control()]: R:rpart::rpart.control()
rpart::rpart(), measures::MMCE(), measures::MSE()
if (requireNamespace("rpart", quietly = TRUE)) {
LearnerRpart$new()
}
## ------------------------------------------------
## Method `LearnerRpart$new`
## ------------------------------------------------
if (requireNamespace("rpart", quietly = TRUE)) {
LearnerRpart$new()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.