English 中文(简体)
SHAP 对分类栏的解释
原标题:SHAP explanation for categorical column

我非常混淆了使用SHAP解释模型时与分类栏做些什么。

As for example, I m using the bike sharing dataset from kaggle (https://www.kaggle.com/datasets/lakshmi25npathi/bike-sharing-dataset)

在对分类栏(即天气/周日)进行热编码之后,对模型进行了培训,并与SHAP做了解释,所解释的特点与一个热编码特征相同。

Is there a way or concept on how to merge back the SHAP value of those one hot encoded feature into single feature? (for example, SHAP value of one hot encoded feature: Weather_Spring, Weather_Summer, Weather_Fall, Weather_Snow back into single column value of Weather)

最佳回答

是:SHAP值是附加值。 因此,你可以增加所有分类元变量的SHAP值,即X美元,以达到其水平的SHAP值。

在实践中,人们很少提到问题:

  • Tree based models usually offer other approaches to deal with categoricals (integer encoding, internal algorithms, internal OHE). There is no need for doing the OHE yourself.
  • For non-tree based models that require OHE, you can pack the preprocessor and the model into a Scikit-Learn pipeline. Then, you also don t have the problem as the SHAP explainer will "see" the original input, not the dummies.
问题回答

暂无回答




相关问题
Multi-variate regression using NumPy in Python?

Is it possible to perform multi-variate regression in Python using NumPy? The documentation here suggests that it is, but I cannot find any more details on the topic.

Regressing panel data in SAS

I am now looking at a panel dataset on which I have to regress. Since I only started my Phd this semester together with the econometrics courses I am still new to many statistic applications and ...

Mysql multivariable linear regression

I am trying to do a multivarible (9 variables) linear regression on data in my mysql 5.0 database (the result value field only has 2 possible values, 1 and 0). I ve done some searching and found I ...

scipy linregress function erroneous standard error return?

I have a weird situation with scipy.stats.linregress seems to be returning an incorrect standard error: from scipy import stats x = [5.05, 6.75, 3.21, 2.66] y = [1.65, 26.5, -5.93, 7.96] gradient, ...

How to do a linear regression into a BIRT report?

How to make a linear regression on the chart displayed into your BIRT report. I have x and y data... but I don t see any function on eclipse BIRT to generate the linear regression... Any idea ? Many ...

热门标签