Closed mhesselbarth closed 5 months ago
Interesting and could be an issue with the dbarts
package and serialization? Maybe worth exploring if the raw model behaves similarly, so taking fit$get_model()
and saving it as rds or so on disk, then load it again and see if the partial calculation works (function for this in the utils_bart script).
If nothing else, the other idea could be to precompute the partials during saving and then save them in this or another object...? Although I know that it can take quite long for individual partials.
Fixed it. Was related to the "state of the sampler", which R's serialization mechanism must be able to access. The trick is to "touch" it as explained here. Added this to the write_model()
function for x$get_name() == "BART-Model"
.
There seems to be an issue when saving a model trained with the
bart
engine to disk, re-loading the model and running thepartial()
function on the object. For the re-loaded model, the response is zero. So far, seems to be a specific issue for thebart
engine.Created on 2024-05-14 with reprex v2.1.0