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

Vasilis/docs #370

Merged
merged 39 commits into from
Jan 19, 2021
Merged

Vasilis/docs #370

merged 39 commits into from
Jan 19, 2021

Conversation

vsyrgkanis
Copy link
Collaborator

changing the doc structure

@vsyrgkanis vsyrgkanis added the enhancement New feature or request label Jan 15, 2021
@vsyrgkanis vsyrgkanis marked this pull request as ready for review January 15, 2021 16:21
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.

Shouldn't there be many more notebook changes to move everything to the new names? Also found a few minor issues.

"intervals, consider passing `inference='bootstrap'` or "
"`inference=econml.inference.BootstrapInference(n_bootstrap_samples=..., bootstrap_type=...)`, "
"as a keyword argument at the `fit` method of the CATE estimator.")
class BootstrapEstimator(bootstrap.BootstrapEstimator):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought you had previously mentioned liking the ease of use for wrapping sklearn estimators as well - do we really want to deprecate that? It seems like a generally useful utility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'll still maintain the estimator in the code. But I think it's important for the users of the econml library to know that this is not the way to use the estimator with our cate estimates and that they shouldn't be using this class directly (we already had some users face this). So I do think we should make it a private class. One can still access it as econml.inference._bootstrap.BootstrapEstimator

econml/deepiv.py Show resolved Hide resolved
econml/drlearner.py Outdated Show resolved Hide resolved
econml/drlearner.py Outdated Show resolved Hide resolved
econml/drlearner.py Outdated Show resolved Hide resolved
Comment on lines 309 to 318
.. testcode::
:hide:

# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.

import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these should only need to be imported once.

Suggested change
.. testcode::
:hide:
# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.
import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unforutnately now that each class is in a separate autosummary page, we need this to be on each page. We can no longer just put it at the top of the file for instance.

Comment on lines 351 to 360
.. testcode::
:hide:

# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.

import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

Suggested change
.. testcode::
:hide:
# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.
import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as above

Comment on lines 474 to 483
.. testcode::
:hide:

# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.

import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator

Choose a reason for hiding this comment

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

And here.

Suggested change
.. testcode::
:hide:
# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.
import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as above

Comment on lines 622 to 631
.. testcode::
:hide:

# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.

import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator

Choose a reason for hiding this comment

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

And here

Suggested change
.. testcode::
:hide:
# Our classes that derive from sklearn ones sometimes include
# inherited docstrings that have embedded doctests; we need the following imports
# so that they don't break.
import numpy as np
from sklearn.linear_model import lasso_path

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as above

econml/iv/tsls/__init__.py Outdated Show resolved Hide resolved
@vsyrgkanis
Copy link
Collaborator Author

Shouldn't there be many more notebook changes to move everything to the new names? Also found a few minor issues.

Most of the actual import paths did not change because the name of the folder is rhe name of the previous file and all public classes of each folder are included in the init

@@ -292,7 +292,7 @@ def test_stratify_orthoiv(self):
X = np.array([1, 1, 2, 2, 1, 2, 1, 2]).reshape(-1, 1)
est = LinearIntentToTreatDRIV(model_Y_X=LinearRegression(), model_T_XZ=LogisticRegression(),
flexible_model_effect=LinearRegression(), cv=2)
inference = BootstrapInference(n_bootstrap_samples=20)
inference = BootstrapInference(n_bootstrap_samples=20, n_jobs=-1, verbose=3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we be testing that the output is more verbose in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure how to do that easily. I’d say lets postpone

@vsyrgkanis vsyrgkanis merged commit a27fa3c into master Jan 19, 2021
@vsyrgkanis vsyrgkanis deleted the vasilis/docs branch January 19, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants