Trusted-AI / Trusted-AI/AIX360
CEMExplainer support for tabular data with categorical features
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 327
- Avg merge
- 1h 13m
- Merged PRs (30d)
- 1
Description
I'm looking to use the contrastive explainer on tabular data which the docs state is supported.
What is the recommended mechanism to deal with categorical features for this explainer?
I've one-hot encoded and then normalized like so:
c_transformer = Pipeline(steps=[('onehot', OneHotEncoder(handle_unknown='ignore')),
('functr', FunctionTransformer(lambda x: x.toarray(), accept_sparse=True)),
('scalar', MinMaxScaler(feature_range=(-0.5, 0.5)))])
The resulting pertinent negatives and positives adjust all values of a category. As an example, here is the delta_pn (which I understand to be the difference needed change the classification) for the sex feature which is binary in this dataset.
sex_Female 0.500000
sex_Male -0.500000
The change impacts both categories. Its unclear how to do the inverse transform for these cases when using one-hot encoding.
Contributor guide
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 with the CEMExplainer documentation entry point linked in the issue and review the shown scikit-learn preprocessing pipeline. Determine how categorical features should be represented and inverse-transformed so one category change does not produce contradictory one-hot values; the work is done when valid pertinent positives and negatives can be mapped back to categorical data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- machine-learning, python, scikit-learn
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100