You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using seaborn to plot the shap values and showing their relation with the data that was used for the prediction to avoid plotting nan values and I notice some differents between the plots. When I am compare both plots I notice that the the shap's api plot overstimates the value of the data.
Comparison:
SHAP plot:
Seaborn plot:
Just to inform, I am using the color map 'bwr' of matplotlib to compare.
Minimal Reproducible Example
importshap# explain is the Explanation objectdic={
'feature_name':'ER',
'shap_values':explain.values[:,0],
'data': explain.data[:,0]
}
# for the seabornsns.swarmplot(x='shap_values', y='feature_name',hue='data', data=dic, palette='bwr', size=3)
# for the shapfig=plt.figure(figsize=(12, 5), dpi=600)
shap.plots.beeswarm(explain[:,['ER']], show=False, max_display=len(explain.feature_names), plot_size=(6,10),
color_bar_label='-', color_bar=True, color='bwr')
Traceback
No response
Expected Behavior
There should be a correspondence between the values of the data in the plots. The color maps should show similar color behavior
Bug report checklist
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest release of shap.
I have confirmed this bug exists on the master branch of shap.
I'd be interested in making a PR to fix this bug
Installed Versions
version: 0.44.0
The text was updated successfully, but these errors were encountered:
Issue Description
I am using seaborn to plot the shap values and showing their relation with the data that was used for the prediction to avoid plotting nan values and I notice some differents between the plots. When I am compare both plots I notice that the the shap's api plot overstimates the value of the data.
Comparison:
![8faf3441-dcb3-4aba-b9b2-886ec27df724](https://private-user-images.githubusercontent.com/63483031/303822767-3cbdb934-b488-4d19-b9a4-89fca01468f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MDg3MzIsIm5iZiI6MTcxOTYwODQzMiwicGF0aCI6Ii82MzQ4MzAzMS8zMDM4MjI3NjctM2NiZGI5MzQtYjQ4OC00ZDE5LWI5YTQtODlmY2EwMTQ2OGYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDIxMDAzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcyNDllNjIzNGQ5MGE0ZTkzMjU2MDZjNzMxM2UzMDYwMzFmY2Q4M2Y4YWIzMmM4YmM4YTUzYzQzNDY5MTgwZjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.51yOK-6iSnDyWSgeIdIGhv7-fW59c5_Vbu9RQFKyu3s)
SHAP plot:
Seaborn plot:
![cfdaccbe-eb0f-4c7a-a30d-606267a659bd](https://private-user-images.githubusercontent.com/63483031/303822799-ae3de036-6f69-4ad2-8844-9802f57c9c75.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MDg3MzIsIm5iZiI6MTcxOTYwODQzMiwicGF0aCI6Ii82MzQ4MzAzMS8zMDM4MjI3OTktYWUzZGUwMzYtNmY2OS00YWQyLTg4NDQtOTgwMmY1N2M5Yzc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDIxMDAzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTViOWVhZjY4MDU0ZTllN2U1NzA0NDI3ZjkyNjU5NjdkNjg3ZmFiMmMyOTRmYmU0OWJhNTZkYmY1Y2YwNjMyYmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._xpYG6MYy0jyfnGnT-rApsEe3T0rOwqYuhU7ay8hy40)
Just to inform, I am using the color map 'bwr' of matplotlib to compare.
Minimal Reproducible Example
Traceback
No response
Expected Behavior
There should be a correspondence between the values of the data in the plots. The color maps should show similar color behavior
Bug report checklist
Installed Versions
version: 0.44.0
The text was updated successfully, but these errors were encountered: