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

Add support to conformalized Bayes for Regression tasks #125

Merged
merged 32 commits into from
Aug 22, 2024

Conversation

pasq-cat
Copy link
Contributor

@pasq-cat pasq-cat commented Aug 5, 2024

add the support to conformalized bayes for regression tasks to conformalprediction.jl (part of gsoc 24)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

where ``\mathcal{D}_{\text{calibration}}`` denotes the designated calibration data.
"""
function MMI.predict(conf_model::BayesRegressor, fitresult, Xnew)
fμ, fvar = MMI.predict(conf_model.model, fitresult, MMI.reformat(conf_model.model, Xnew)...)


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶


[JuliaFormatter] reported by reviewdog 🐶

@pasq-cat
Copy link
Contributor Author

pasq-cat commented Aug 16, 2024

@MojiFarmanbar there is a compatibility issue between laplaceredux and the Random package affecting ONLY julia 1.7
image.

I think the issue is that the laplaceredux package only support Random 1.9 or 1.10 when Random seems to be at version 1.7

conformalprediction.jl does not seem to have the same problem because in compat it has Random = "1.7, 1.8, 1.9, 1.10"

do we need to make a new small release of lapalceredux?

@pasq-cat
Copy link
Contributor Author

i will try

@MojiFarmanbar
Copy link
Member

@Rockdeldiablo i would suggest let's focus on classification part. for this we can wait for Patrick, he is more experienced than me regarding packaging in Julia. I will also look at it

@pat-alt
Copy link
Member

pat-alt commented Aug 21, 2024

Let's remove legacy compat and just use 1.9, 1.10 where 1.10 is the new LTS. Make sure to also remove tests on legacy version from the CI.yml

@pat-alt pat-alt self-requested a review August 21, 2024 12:18
Copy link
Member

@pat-alt pat-alt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking really good to me but some minor comments as discussed.

Let's change this PR to 'Bayes Regression only', properly document and test things and then merge.

Then classification in another final PR

return:
- the probability of observing a value y given a mean fμ and a variance fvar.
"""
function ConformalBayes(y, fμ, fvar)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a different name for the function (or in any case not use camel case)

src/conformal_models/heuristics.jl Show resolved Hide resolved
@pasq-cat
Copy link
Contributor Author

@pat-alt if i remove the assert a lot of test fails because the test file is written so that normal deterministic neural networks are used for regression. It's not a problem of BayesRegressor. what do i do?

@pasq-cat pasq-cat changed the title Inductive bayes Bayes Regression only Aug 21, 2024
@pasq-cat pasq-cat requested a review from pat-alt August 21, 2024 13:56
@pasq-cat
Copy link
Contributor Author

@pat-alt how do i solve this issue?
"
Got exception outside of a @test
ArgumentError: There is no model named "BayesRegressor" in the registry.
Run models() to view all registered models, or models(needle) to restrict search to models with string needle in their name or documentation.
Stacktrace:"

models() it's not recognized as a command

@pat-alt
Copy link
Member

pat-alt commented Aug 22, 2024

Ahh I think this is because LaplaceRedux has not been added to MLJ's model registry. Could you open an issue for that on LR.jl please? For now I think here we will indeed have to depend on LR.jl to have access to the model type

@pasq-cat
Copy link
Contributor Author

Ahh I think this is because LaplaceRedux has not been added to MLJ's model registry. Could you open an issue for that on LR.jl please? For now I think here we will indeed have to depend on LR.jl to have access to the model type

so for now i reintroduce the assert and install laplaceredux so that the tests do not give errors? then, when laplaceredux is added to MLJ we can remove this constrain

@pat-alt
Copy link
Member

pat-alt commented Aug 22, 2024

Yes, let's do that 👍🏽

@MojiFarmanbar MojiFarmanbar merged commit db324d5 into main Aug 22, 2024
3 checks passed
@pasq-cat pasq-cat changed the title Bayes Regression only Add support to conformalized Bayes for Regression tasks Aug 31, 2024
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.

Support for thresholding predictive distributions as explained in Section 2.4 of the tutorial
3 participants