-
Notifications
You must be signed in to change notification settings - Fork 727
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
Basic monte carlo framework for simulating dgps and methods #216
base: main
Are you sure you want to change the base?
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.
Added some comments.
Also, because it's empty I couldn't comment there, but is init.py necessary? Elsewhere we're just using namespace packages which doesn't require such a file.
montecarlo/econml_dml_te.py
Outdated
@@ -0,0 +1,180 @@ | |||
from econml.dml import DMLCateEstimator, LinearDMLCateEstimator, SparseLinearDMLCateEstimator, ForestDMLCateEstimator |
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.
Add copyright header.
Also consider adding a description of what this file is for.
montecarlo/mc_from_config.py
Outdated
@@ -0,0 +1,15 @@ | |||
import sys |
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.
Add copyright header.
montecarlo/mc_from_config.py
Outdated
import importlib | ||
|
||
def monte_carlo_main(): | ||
parser = argparse.ArgumentParser(description='Process some integers.') |
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.
If this is intended as the main entrypoint to the framework, it should have docstrings explaining its use.
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, the description here seems wrong.
@@ -0,0 +1,63 @@ | |||
import numpy as np |
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.
Add copyright header.
@@ -0,0 +1,63 @@ | |||
import numpy as np | |||
|
|||
def l1_error(x, y): return np.linalg.norm(x-y, ord=1) |
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.
Add docstrings to all functions.
montecarlo/mcpy/utils.py
Outdated
@@ -0,0 +1,12 @@ | |||
import numpy as np |
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.
Add copyright header
montecarlo/sweep_config_dml_te.py
Outdated
@@ -0,0 +1,90 @@ | |||
import os |
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.
Add copyright header
montecarlo/sweep_config_dml_te.py
Outdated
'plot3': plotting.plot_violin | ||
}, | ||
"per_plots": ['coverage_band'], | ||
"sweep_plots": { |
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.
Delete dead code
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 commented this out so that the experiments wouldn't take a long time to run on my laptop - so I'd just be calculating metrics for two estimators instead of four. I can uncomment things under method_opts {} but I'll still leave the third and fourth methods commented for now under methods {}
montecarlo/sweep_mc_from_config.py
Outdated
@@ -0,0 +1,15 @@ | |||
import sys |
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.
Add copyright header
montecarlo/sweep_mc_from_config.py
Outdated
from mcpy.monte_carlo import MonteCarloSweep | ||
import importlib | ||
|
||
def monte_carlo_main(): |
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.
Do we need this many similar entrypoints (here vs. mc_from_config vs. monte_carlo.py itself)? Could you consolidate them?
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.
Makes sense to take out the one in monte_carlo.py because the methods from there are meant to be imported, so I'll take out the main() function in that.
Built on top of https://github.com/vsyrgkanis/plugin_regularized_estimation
Changes made to to fit econml's structure
Documentation upcoming