ReactiveBayes / RxInfer.jl

Julia package for automated Bayesian inference on a factor graph with reactive message passing
MIT License
265 stars 23 forks source link

Hierarchical Bayesian Linear Regression example #187

Closed bvdmitri closed 10 months ago

bvdmitri commented 10 months ago

This PR adds a new tutorial for Hierarchical Bayesian Linear Regression, which is a direct comparison against NumPyro.

review-notebook-app[bot] commented 10 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (223377e) 80.23% compared to head (3b8d3d2) 80.23%.

:exclamation: Current head 3b8d3d2 differs from pull request most recent head 2457a54. Consider uploading reports for the commit 2457a54 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #187 +/- ## ======================================= Coverage 80.23% 80.23% ======================================= Files 11 11 Lines 1285 1285 ======================================= Hits 1031 1031 Misses 254 254 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bvdmitri commented 10 months ago

So, based on @bartvanerp's suggestion, we're trying to keep things simple and not overload with too many examples or tutorials, especially after our recent cleanup. Instead of throwing in a whole new notebook, I just merged it with our existing Bayesian linear regression. It got a bit bigger, but now it covers all kinds of linear regression scenarios with RxInfer— simple, complex, known noise, unknown noise, univariate, multivariate, and hierarchical.

The tutorial is split into two parts: the first is a quick guide using made-up data, and the second part is a remix of the NumPyro tutorial, using real data from Kaggle.

bvdmitri commented 10 months ago

We cannot fix it now :( The prediction functionality is not really suitable for this use case, I simply removed the TODO because there is actually nothing wrong with the code IMO.