inst/tinytest/test-generics-errors.R

source(system.file("common", "friedmanData.R", package = "dbarts"), local = TRUE)

# test that predict fails if sampler not saved
bartFit <- dbarts::bart(
  testData$x, testData$y, ndpost = 20, nskip = 5, ntree = 5L, verbose = FALSE
)
expect_error(predict(bartFit, testData$x, n.threads = 1L))

rm(bartFit)

rm(testData)

Try the dbarts package in your browser

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

dbarts documentation built on April 3, 2025, 5:25 p.m.