mlr_learners_classif.bart | R Documentation |
Bayesian Additive Regression Trees are similar to gradient boosting algorithms.
The classification problem is solved by 0-1 encoding of the two-class targets and setting the
decision threshold to p = 0.5 during the prediction phase.
Calls dbarts::bart()
from dbarts.
This Learner can be instantiated via lrn():
lrn("classif.bart")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, dbarts
Id | Type | Default | Levels | Range |
ntree | integer | 200 | [1, \infty) |
|
k | numeric | 2 | [0, \infty) |
|
power | numeric | 2 | [0, \infty) |
|
base | numeric | 0.95 | [0, 1] |
|
binaryOffset | numeric | 0 | (-\infty, \infty) |
|
ndpost | integer | 1000 | [1, \infty) |
|
nskip | integer | 100 | [0, \infty) |
|
printevery | integer | 100 | [0, \infty) |
|
keepevery | integer | 1 | [1, \infty) |
|
keeptrainfits | logical | TRUE | TRUE, FALSE | - |
usequants | logical | FALSE | TRUE, FALSE | - |
numcut | integer | 100 | [1, \infty) |
|
printcutoffs | integer | 0 | (-\infty, \infty) |
|
verbose | logical | FALSE | TRUE, FALSE | - |
nthread | integer | 1 | (-\infty, \infty) |
|
keepcall | logical | TRUE | TRUE, FALSE | - |
sampleronly | logical | FALSE | TRUE, FALSE | - |
seed | integer | NA | (-\infty, \infty) |
|
proposalprobs | untyped | NULL | - | |
splitprobs | untyped | NULL | - | |
keepsampler | logical | - | TRUE, FALSE | - |
Parameter: keeptrees
Original: FALSE
New: TRUE
Reason: Required for prediction
Parameter: offset
The parameter is removed, because only dbarts::bart2
allows an offset during training,
and therefore the offset parameter in dbarts:::predict.bart
is irrelevant for
dbarts::dbart
.
Parameter: nchain, combineChains, combinechains
The parameters are removed as parallelization of multiple models is handled by future.
Parameter: sigest, sigdf, sigquant, keeptres
Regression only.
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifBart
new()
Creates a new instance of this R6 class.
LearnerClassifBart$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifBart$clone(deep = FALSE)
deep
Whether to make a deep clone.
ck37
Sparapani, Rodney, Spanbauer, Charles, McCulloch, Robert (2021). “Nonparametric machine learning and efficient computation with bayesian additive regression trees: the BART R package.” Journal of Statistical Software, 97, 1–66.
Chipman, A H, George, I E, McCulloch, E R (2010). “BART: Bayesian additive regression trees.” The Annals of Applied Statistics, 4(1), 266–298.
Dictionary of Learners: mlr3::mlr_learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner
learner = mlr3::lrn("classif.bart")
print(learner)
# Define a Task
task = mlr3::tsk("sonar")
# Create train and test set
ids = mlr3::partition(task)
# Train the learner on the training ids
learner$train(task, row_ids = ids$train)
print(learner$model)
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.