-
Notifications
You must be signed in to change notification settings - Fork 767
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
Update filters.py #281
Update filters.py #281
Conversation
Smooth label count per treatment in _GetNodeSummary() by adding 1 for (treatment, label) combinations that do not occur naturally in the data.
Fixed ModuleNotFoundError: No module named 'sklearn.utils.testing'
Fixed ModuleNotFoundError: No module named 'sklearn.utils.testing'
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.
Thanks for contributing! Please find my comments inline
@@ -191,7 +198,12 @@ def _GetNodeSummary(data, | |||
for ti in treatment_group_keys: | |||
results.update({ti: {}}) | |||
for ci in y_name_keys: | |||
results[ti].update({ci: results_series[ti, ci]}) | |||
if smooth: | |||
results[ti].update({ci: results[ti].update({ci: results_series[ti, ci] |
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.
Seems ci
will all be None
as dictionary updating method doesn't return any value, I don't think that's what you are trying to do here?
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.
Fixed. That was a clumsy copy-paste job that I overlooked somehow.
Currently the build is failing because shap is missing IPython as dependency. There is a PR related to fix this issue with Shap shap/shap#1749 |
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.
Thanks for the contribution!
We get a KeyError issue in feature_selection/filters.py L197-203 when certain (treatment, y_label) combinations do not occur naturally in the dataset, e.g., if we never see label=1 for "treatment1".
Proposed changes
We can smooth label counts per treatment in _GetNodeSummary() by adding 1 for (treatment, label) combinations that do not occur naturally in the data. Issue opened @ #280
Types of changes
What types of changes does your code introduce to CausalML?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc. This PR template is adopted from appium.