Bug when passing featurizer that requires more than 1 row in SparseLinearDrLearner
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.8k
- Forks
- 827
- PR merge metrics
- No merged PRs in 30d
Description
in file econml/utilities.py:75 (function name check_high_dimensional):
d_x = clone(featurizer, safe=False).fit_transform(X[[0], :]).shape[1]
when passing a transformer such as SplineTransformer, it raises an error:
ValueError: Found array with 1 sample(s) (shape=(1, 1)) while a minimum of 2 is required by SplineTransformer.
from what I understand this line only runs to infer the number of rows out, but it fails the whole fit process.
this would also fail for transformers as OneHotEncoder as the number of new rows is dependent on the data
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in econml/utilities.py at check_high_dimensional and trace how SparseLinearDrLearner calls it. Compare the behavior of the mentioned SplineTransformer and OneHotEncoder cases, then verify that fitting no longer fails for transformers requiring multiple rows and that the inferred output dimensionality remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, scikit-learn
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100