stan4bart icon indicating copy to clipboard operation
stan4bart copied to clipboard

Var list changing size

Open jlevy44 opened this issue 2 years ago • 2 comments

I am trying to fit a stan4bart model after the latest update but am getting the following error:

fit <- stan4bart(dx ~ bart(. - dx - history) + history,  dat_new[dat_new$train,],
                 cores = 1, seed = 0,
                 verbose = 1,
                 bart_args=list(keepTrees=T),
                 test=dat_new[!dat_new$train,])
'varlist' has changed (from nvar=9) to new 10 after EncodeVars() -- should no longer happen!

jlevy44 avatar Mar 23 '22 21:03 jlevy44

I was able to get this to work by directly converting my data frame into a model matrix and back to a data frame. Perhaps some of the issue could be with factor variable encoding?

jlevy44 avatar Mar 23 '22 21:03 jlevy44

Is this with an install from a recent commit? I made some changes last week to hopefully address this, and I can't recreate it locally.

vdorie avatar Mar 24 '22 21:03 vdorie