saberpowers/causalLearning

causalBoosting does not run

Closed this issue · 1 comments

Thanks for writing this library! The bagged causalMARS model has a greater uplift than the causal forests from the grf library. I know this is in beta, but thought I would throw up an issue anyways...

Unfortunately, I am having trouble running causalBoosting. I'm not very good at R so, I apologize for not being more specific.

I am trying to run the following line.

  cb.model <- causalLearning::causalBoosting(X[inds,], W[inds], Y[inds])

R is giving me the following error:

Error in causalLearning::causalBoosting(X[inds, ], W[inds], Y[inds]) : 
  (list) object cannot be coerced to type 'double'

My X is multidimensional, so I believe that the call to as.double(x) in causalBoosting.R is throwing this error. I tried unlisting the matrix and I got another error.

Let me know if you know what as going on! Would love to compare the performance of causal boosting to causal MARS.

Thanks @easadler. I suspect that the problem here is that your X has type data.frame, and causalBoosting() expects a matrix type. I've made an issue to handle inputs better. In the meantime, the following band-aid should allow you to run causalBoosting() on your data:

cb.model <- causalLearning::causalBoosting(as.matrix(X[inds, ]), W[inds], Y[inds])

Please re-open the issue if this doesn't work.