Imported from https://github.com/UBS-IB/bayesian_tree