-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add Delta Method Analysis #208
Conversation
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.
lgtm but suggesting a few minor changes. Also bump the library via the toml, please :)
@@ -254,6 +255,7 @@ def _raise_error_if_missing(self, attr, other_attr): | |||
"ttest_clustered": TTestClusteredAnalysis, | |||
"paired_ttest_clustered": PairedTTestClusteredAnalysis, | |||
"mlm": MLMExperimentAnalysis, | |||
"delta": DeltaMethodAnalysis, |
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.
also, you're adding it here but not adding the scale parameter in here. I think we need to add it if we want to init via config. I would also test init via config, I think it's missing
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.
I am not sure what you mean here. I get that it might be tricky to know that you have to pass an additional parameter or that the "scale" column has to appear somewhere. Is this what you are refering to?
If that is the case, do you have any recommendation on how to go around this? I am not sure I understand how to do it properly...
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 needs to work like this:
config = {
"analysis": "delta",
"perturbator": "constant",
"splitter": "non_clustered",
"n_simulations": 50,
"scale_col": "y",
"target_col": "x"
}
pw = PowerAnalysis.from_dict(config)
power = pw.power_analysis(df, average_effect=0.1)
I think we need to pass the scale_col in the from_config. Please have a read at the from_config in PowerAnalysis, ExperimentAnalysis, etc and if you don't know how it's working let me know
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 was pretty clear, thanks!
I think that now it should be working. I had to do some changes and raise a couple of additional errors to save guard.
When time allows, could you check again and give more feedback?
Thanks!
Also, create issues for:
|
f5c531c
to
239666e
Compare
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.
One last thing and we can merge, can you add a test where you create a PowerAnalysis with delta from config?
This PR adds Delta Method Analysis. It works with PowerAnalysis pipelines out-of-the-box.
Also added a couple of unit tests to ensure it is working appropiately.
It still needs to be hooked up with the Inference pipeline. Expected to do it at a later stage to split the PR.