vdorie / bartCause

Causal Inference using Bayesian Additive Regression Trees
77 stars 10 forks source link

n.threads not working #11

Closed cls3415 closed 3 years ago

cls3415 commented 3 years ago

Hi Vincent- I used n.threads = 1L as augment in bartc function, but the function used all cores of the machine.

image

fit <- bartc(dat2$Y, dat2$TREAT1, dat2[,var1], n.chains = 2L, seed = 100223, keepTrees = TRUE, n.threads = 1L, n.samples = 10L)

Thanks!

cls3415 commented 3 years ago

Figure out why. I should have put n.threads = 1L in both args.rsp and args.trt arguments. The following command works:

fit <- bartc(dat2$Y, dat2$TREAT1, dat2[,var1], n.chains = 2L, seed = 100223, keepTrees = TRUE, args.rsp = list(n.threads = 1L), 
             args.trt = list(n.threads = 1L))