Skip to content

Commit f57b268

Browse files
committed
Updated R package and unit tests
1 parent 8588864 commit f57b268

File tree

5 files changed

+41
-37
lines changed

5 files changed

+41
-37
lines changed

man/compute_bart_posterior_interval.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/sample_bart_posterior_predictive.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/sample_bcf_posterior_predictive.Rd

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/R/testthat/test-bcf.R

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -615,19 +615,21 @@ test_that("BCF Predictions", {
615615
# Run a BCF model with only GFR
616616
general_params <- list(num_chains = 1, keep_every = 1)
617617
variance_forest_params <- list(num_trees = 50)
618-
bcf_model <- bcf(
619-
X_train = X_train,
620-
y_train = y_train,
621-
Z_train = Z_train,
622-
propensity_train = pi_train,
623-
X_test = X_test,
624-
Z_test = Z_test,
625-
propensity_test = pi_test,
626-
num_gfr = 10,
627-
num_burnin = 0,
628-
num_mcmc = 10,
629-
general_params = general_params,
630-
variance_forest_params = variance_forest_params
618+
expect_warning(
619+
bcf_model <- bcf(
620+
X_train = X_train,
621+
y_train = y_train,
622+
Z_train = Z_train,
623+
propensity_train = pi_train,
624+
X_test = X_test,
625+
Z_test = Z_test,
626+
propensity_test = pi_test,
627+
num_gfr = 10,
628+
num_burnin = 0,
629+
num_mcmc = 10,
630+
general_params = general_params,
631+
variance_forest_params = variance_forest_params
632+
)
631633
)
632634

633635
# Check that cached predictions agree with results of predict() function

test/R/testthat/test-predict.R

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -375,18 +375,20 @@ test_that("BCF predictions with pre-summarization", {
375375

376376
# Fit a heteroskedastic BCF model
377377
var_params <- list(num_trees = 20)
378-
het_bcf_model <- bcf(
379-
X_train = X_train,
380-
Z_train = Z_train,
381-
y_train = y_train,
382-
propensity_train = pi_train,
383-
X_test = X_test,
384-
Z_test = Z_test,
385-
propensity_test = pi_test,
386-
num_gfr = 10,
387-
num_burnin = 0,
388-
num_mcmc = 10,
389-
variance_forest_params = var_params
378+
expect_warning(
379+
het_bcf_model <- bcf(
380+
X_train = X_train,
381+
Z_train = Z_train,
382+
y_train = y_train,
383+
propensity_train = pi_train,
384+
X_test = X_test,
385+
Z_test = Z_test,
386+
propensity_test = pi_test,
387+
num_gfr = 10,
388+
num_burnin = 0,
389+
num_mcmc = 10,
390+
variance_forest_params = var_params
391+
)
390392
)
391393

392394
# Check that the default predict method returns a list

0 commit comments

Comments
 (0)