Ignoring one feature's contribution at inference stage
Hi,
I am wondering whether the EBM package could support the following scenario.
I assume the EBMRegression is similar to GAM which tries to model `y = \sum_{i}^P f(x_i)`, where there are P features to predict `y`.
In the inference stage, I would ignore one feature's contribution.
For example, I am trying to use age, #cigarettes, and community location to predict whether the man will have lung cancer or not in terms of probability. The feature community location is added to prevent that there is bias. In the prediction stage, I am more concerned to get the effect of age and #cigarettes. Could we achieve this using the EBM package?
Thanks for your help!
Hi @anlijuncn -- Yes, that is easy to achieve. You can simply zero the community_location feature and it will no longer contribute to the prediction. That can be done with the following:
ebm.term_scores_[feature_index] = np.zeros_like(ebm.term_scores_[feature_index])
You'll also want to ensure that community_location is not still contributing through an interaction effect. You can do this either by zeroing any interactions that involve community_location, or probably better through the "exclude" parameter that will be in our next release.
Thank you so much, Paul! I am going to have a try.