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

Basic monte carlo framework for simulating dgps and methods #216

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

v-asatha
Copy link

Built on top of https://github.com/vsyrgkanis/plugin_regularized_estimation
Changes made to to fit econml's structure
Documentation upcoming

@msftclas
Copy link

msftclas commented Jan 30, 2020

CLA assistant check
All CLA requirements met.

Copy link
Collaborator

@kbattocchi kbattocchi left a 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.

@@ -0,0 +1,180 @@
from econml.dml import DMLCateEstimator, LinearDMLCateEstimator, SparseLinearDMLCateEstimator, ForestDMLCateEstimator
Copy link
Collaborator

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.

@@ -0,0 +1,15 @@
import sys
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add copyright header.

import importlib

def monte_carlo_main():
parser = argparse.ArgumentParser(description='Process some integers.')
Copy link
Collaborator

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.

Copy link
Collaborator

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
Copy link
Collaborator

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)
Copy link
Collaborator

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.

@@ -0,0 +1,12 @@
import numpy as np
Copy link
Collaborator

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,90 @@
import os
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add copyright header

'plot3': plotting.plot_violin
},
"per_plots": ['coverage_band'],
"sweep_plots": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Delete dead code

Copy link
Author

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 {}

@@ -0,0 +1,15 @@
import sys
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add copyright header

from mcpy.monte_carlo import MonteCarloSweep
import importlib

def monte_carlo_main():
Copy link
Collaborator

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?

Copy link
Author

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.

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.

None yet

3 participants