I do BART models all the time for work so to speed things up I started using pymc-bart-rs. It had errors when I tried to use the plotting functions so I checked out a branch, made some changes (with chatgpt for the rust code and wrapper stuff. I have never coded in rust), and got it to work with full functionality (I think) and it works with pymc 5.27.0. It might be useful to other people so I thought I might contribute? Would anyone want to see the code? I have never contributed to an open source package before so I don’t really know how to go about doing that. I haven’t thoroughly tested it and I don’t know open source coding best practices.
@gstechschulte thank you so much for writing this package!
3 Likes
@mikesmith5446 that sounds awesome. Do you know how to do a Pull Request? That’s the standard way of proposing changes and would be the ideal route for you to contribute. If you are not familiar or interested in learning how to do that, you can share the code by other means.
@aloctavodia That pull request I submitted keeps failing tests and I’m not quite sure how to fix that.
I tested that version on some real data and while the sampling was fast the utility functions were still kind of slow so I created this version:
This version passes the random_seed argument from pymc.sample into the Rust back end for sampling. You can run 4 chains in parallel and the tree ensembles are collected in bartrv.owner.op.all_trees as bytes objects. When you first run any of the utils functions that call _sample_posterior the trees get sent back to rust so sample posterior can run in rust.
Hi @big_data_mike Thanks for your contribution! This is great. I’m very busy this week with other things, but I’ll make time to review this next week.
1 Like