man/rmd/bart_dbarts.md

For this engine, there are multiple modes: classification and regression

Tuning Parameters

This model has 4 tuning parameters:

Parsnip changes the default range for trees to c(50, 500).

Important engine-specific options

Some relevant arguments that can be passed to set_engine():

Translation from parsnip to the original package (classification)

parsnip::bart(
  trees = integer(1),
  prior_terminal_node_coef = double(1),
  prior_terminal_node_expo = double(1),
  prior_outcome_range = double(1)
) |> 
  set_engine("dbarts") |> 
  set_mode("classification") |> 
  translate() |> 
  print_model_spec()
## BART Model Specification (classification)
## 
## Main Arguments:
##   trees = integer(1)
##   prior_terminal_node_coef = double(1)
##   prior_terminal_node_expo = double(1)
##   prior_outcome_range = double(1)
## 
## Computational engine: dbarts 
## 
## Model fit template:
## dbarts::bart(x = missing_arg(), y = missing_arg(), ntree = integer(1), 
##     base = double(1), power = double(1), k = double(1), verbose = FALSE, 
##     keeptrees = TRUE, keepcall = FALSE)

Translation from parsnip to the original package (regression)

parsnip::bart(
  trees = integer(1),
  prior_terminal_node_coef = double(1),
  prior_terminal_node_expo = double(1),
  prior_outcome_range = double(1)
) |> 
  set_engine("dbarts") |> 
  set_mode("regression") |> 
  translate()|> 
  print_model_spec()
## BART Model Specification (regression)
## 
## Main Arguments:
##   trees = integer(1)
##   prior_terminal_node_coef = double(1)
##   prior_terminal_node_expo = double(1)
##   prior_outcome_range = double(1)
## 
## Computational engine: dbarts 
## 
## Model fit template:
## dbarts::bart(x = missing_arg(), y = missing_arg(), ntree = integer(1), 
##     base = double(1), power = double(1), k = double(1), verbose = FALSE, 
##     keeptrees = TRUE, keepcall = FALSE)

Preprocessing requirements

Factor/categorical predictors need to be converted to numeric values (e.g., dummy or indicator variables) for this engine. When using the formula method via \code{\link[=fit.model_spec]{fit()}}, parsnip will convert factor columns to indicators.

[dbarts::bart()] will also convert the factors to indicators if the user does not create them first.

Prediction types

parsnip:::get_from_env("bart_predict") |>
  dplyr::select(mode, type) |> 
  print(n = Inf)
## # A tibble: 9 x 2
##   mode           type    
##   <chr>          <chr>   
## 1 regression     numeric 
## 2 regression     raw     
## 3 regression     conf_int
## 4 regression     pred_int
## 5 classification class   
## 6 classification prob    
## 7 classification conf_int
## 8 classification pred_int
## 9 classification raw

References



Try the parsnip package in your browser

Any scripts or data that you put into this service are public.

parsnip documentation built on Jan. 11, 2026, 9:06 a.m.