Skip to content

Commit

Permalink
Address more PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kbattocchi committed May 8, 2021
1 parent 513d7af commit c6f5f1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 0 additions & 11 deletions doc/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,6 @@ Utilities

econml.utilities

Solutions
---------

Causal Feature Importance
^^^^^^^^^^^^^^^^^^^^^^^^^

.. autosummary::
:toctree: _autosummary

econml.solutions.causal_analysis

Private Module Reference
========================

Expand Down
6 changes: 6 additions & 0 deletions econml/solutions/causal_analysis/_causal_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ def fit(self, X, y, warm_start=False):
if heterogeneity_inds == [] or isinstance(heterogeneity_inds[0], (int, str, bool)):
heterogeneity_inds = [heterogeneity_inds for _ in train_inds]

# heterogeneity inds should be a 2D list of length same as train_inds
elif heterogeneity_inds is not None and len(heterogeneity_inds) != len(train_inds):
raise ValueError("Heterogeneity indexes should have the same number of entries, but here "
f" there were {len(heterogeneity_inds)} heterogeneity entries but "
f" {len(train_inds)} feature indices.")

# replace None elements of heterogeneity_inds and ensure indices are numeric
heterogeneity_inds = {ind: list(range(X.shape[1])) if hinds is None else _get_column_indices(X, hinds)
for ind, hinds in zip(train_inds, heterogeneity_inds)}
Expand Down

0 comments on commit c6f5f1e

Please sign in to comment.