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

BART: add partial dependence plots and individual conditional expectation plots #5091

Merged
merged 7 commits into from
Nov 3, 2021

Conversation

aloctavodia
Copy link
Member

@aloctavodia aloctavodia commented Oct 21, 2021

This add functions to compute partial dependence plots and individual conditional expectation plots. It also move the in-sample and out-of-sample function predictions to the function predict, also part of bart.utils. After this PR is merged I will add an example of how to use these function and BART in general.

This is an example of a partial dependence plot, where BART is used to predict the number of rented bikes given 4 covariates.

index

@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #5091 (24bc496) into main (598dd9d) will increase coverage by 2.67%.
The diff coverage is 89.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5091      +/-   ##
==========================================
+ Coverage   75.10%   77.77%   +2.67%     
==========================================
  Files          87       88       +1     
  Lines       14142    14080      -62     
==========================================
+ Hits        10621    10951     +330     
+ Misses       3521     3129     -392     
Impacted Files Coverage Δ
pymc/sampling.py 86.80% <85.71%> (-0.01%) ⬇️
pymc/bart/utils.py 88.52% <88.52%> (ø)
pymc/bart/pgbart.py 96.24% <90.00%> (+4.79%) ⬆️
pymc/bart/__init__.py 100.00% <100.00%> (ø)
pymc/bart/bart.py 95.45% <100.00%> (-1.16%) ⬇️
pymc/bart/tree.py 100.00% <100.00%> (+3.33%) ⬆️
pymc/aesaraf.py 90.10% <0.00%> (-1.38%) ⬇️
pymc/distributions/logprob.py 94.93% <0.00%> (-0.96%) ⬇️
pymc/distributions/dist_math.py 87.70% <0.00%> (-0.54%) ⬇️
pymc/distributions/transforms.py 91.95% <0.00%> (-0.44%) ⬇️
... and 24 more

@twiecki
Copy link
Member

twiecki commented Oct 22, 2021

Can you post an example plot of what it looks like?

Also, have you considered spawning this out into a separate package pymc-bart?

@aloctavodia
Copy link
Member Author

I have not considered a separated package. But not opposed to that. Most of the logic for BART is now on its own module. The only exception is the code related to the automatic assignment of PGBART sampler to BART variables.

@ricardoV94
Copy link
Member

Maybe we can harbor these more specialized modules until they grow stable/popular and then spin them off to their own packages?

@aloctavodia
Copy link
Member Author

Maybe that's a good strategy. One spin off library could be a more machine-learning/Bayesian non-paramateric kind of library and not just a BART library.

Additionally one interesting feature of our BART implementation is precisely that is PPL friendly. There is still a lot of room for improvement and exploration here. Both at the implementation level and at the level of the types of model we can build and their uses.

@aloctavodia
Copy link
Member Author

@twiecki @ricardoV94 can we merge this?

@ricardoV94
Copy link
Member

@aloctavodia do you want to add a release note about the new features?

@aloctavodia aloctavodia merged commit 52a126d into pymc-devs:main Nov 3, 2021
@aloctavodia aloctavodia deleted the bart_utils branch November 3, 2021 12:25
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

Successfully merging this pull request may close these issues.

3 participants