-
Notifications
You must be signed in to change notification settings - Fork 88
Add variable selection priors #568
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
| :param vs_prior_type : str or None, default=None | ||
| Type of variable selection prior: 'spike_and_slab', 'horseshoe', or None. | ||
| If None, uses standard normal priors. | ||
| :param vs_hyperparams : dict, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sphinx format and not numpy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add that into AGENTS.md if it's not already there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sphinx format and not numpy
You got me. The doc strings were AI generated. Will fix.
| Provides continuous shrinkage with heavy tails, allowing strong signals | ||
| to escape shrinkage while weak signals are dampened: | ||
| β_j = τ · λ̃_j · β_j^raw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to add maths in here for nice rendering in the API docs
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #568 +/- ##
==========================================
+ Coverage 91.95% 92.27% +0.31%
==========================================
Files 33 35 +2
Lines 4776 5050 +274
==========================================
+ Hits 4392 4660 +268
- Misses 384 390 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
|
Marking this one as ready for review. There is still some work to be done on the notebook illustrating the functionality. But i think there is enough here that's it worth flagging the architecture choices for discussion. I've made the variable selection priors available as a module. Currently, just integrated with the IV class, but in principle can be dropped into all regression based modules with coefficients. The pattern simply requires an if-else block to be used in e.g. the propensity score model, linear regression model etc.... What do you guys think? |
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
|
Great @NathanielF ! I think the notebooks need a bit more storyline and explanation 🙏 |
|
Cool, thanks @juanitorduz . I can take another pass at it this weekend. |
|
Will take a look at this. But it's worth updating from |
| @@ -0,0 +1,2219 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be worth adding a graphviz DAG here to represent the DGP for the simulated data.
I'd also be tempted to add a corresponding short paragraph to explain the data setup a bit.
Could add in a link to the knowledge base page you recently added
Reply via ReviewNB
| @@ -0,0 +1,2219 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add bibtex references (and citations in text) for the spike-and-slab and the horseshoe.
For the horseshoe, are the lambdas also {0,1} ?
Reply via ReviewNB
| @@ -0,0 +1,2219 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temperature and pi could more clearly map on to the equations given in the above spike-and-slab + horseshoe sections
Reply via ReviewNB
| @@ -0,0 +1,2219 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,2219 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a bit of explanation. I'm still not over my cold, so I'm probably missing something, but my naive prediction would be that parameters would be heaped at zero. Could you just add something in there to address whatever misunderstanding I have there
Reply via ReviewNB
| @@ -0,0 +1,2219 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,2219 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Added some comments on the new notebook. Not looked at the code yet. |
Just a draft for the minute. Working through some ideas.
📚 Documentation preview 📚: https://causalpy--568.org.readthedocs.build/en/568/