-
Notifications
You must be signed in to change notification settings - Fork 716
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
Vasilis/docs #370
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.
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): |
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 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.
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'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
.. 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 | ||
|
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 think these should only need to be imported once.
.. 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 |
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.
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.
.. 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 | ||
|
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.
Same here.
.. 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 |
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.
same as above
.. 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 | ||
|
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.
And here.
.. 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 |
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.
same as above
.. 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 | ||
|
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.
And here
.. 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 |
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.
same as above
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) |
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.
Should we be testing that the output is more verbose in this case?
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.
Not sure how to do that easily. I’d say lets postpone
changing the doc structure