Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a frequentist model from BART model #147

Open
ggmirandac opened this issue Mar 4, 2024 · 3 comments
Open

Getting a frequentist model from BART model #147

ggmirandac opened this issue Mar 4, 2024 · 3 comments

Comments

@ggmirandac
Copy link

Short Description

Hi, I have been wordering if there is a way to connect the bart regression model with some other tree based model, like XGboost or sklearn's trees. This in order to use the bart model to estimate some of the parameters of these models and then use the other tree models to generate SHAP values. This is based on the following blog in towardsdatascience.com: Bayesian inference.

This will generate a more thorough analysis of the black box model generated from the BART model.

Code Example or link

This can be seen in examples from : this blog post

And the shap value package is: shap

Relevant documentation or public examples

@aloctavodia
Copy link
Member

Hi,

Thanks for sharing

What do you mean by "frequentist model"?

From a quick look at that notebook, what you need is to make predictions from a model and then pass those predictions to the shape package. That's something you can do with any PyMC model including BART models. You can compute predictions using pm.sample_posterior_predictive, no need to rewrite the model as in the notebook you shared. The author builds a SimpleModel class, which seems unnecessary to me.

I think we can add an example of this to the docs.

@aloctavodia
Copy link
Member

Ohh, now I understand, the shap package is expecting an object with a prediction method. I guess that is what you mean by getting a "frequentist model". Still, the approach in that notebook is not very "pymc-onic". I guess the best approach will be to provide a utility function to simplify the user experience.

@ggmirandac
Copy link
Author

Yeah,

Thanks for the consideration :D

Bests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants