You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于SHAP decision_plot的理解问询:基准值、输出及颜色含义等问题

Hey there! Let me break down these SHAP decision plot questions for you—they’re super common when you first dive into SHAP, so don’t feel stuck!

Understanding SHAP Decision Plots: Your Questions Answered

1. What’s the Base Value?

The base value (often noted as E[f(X)] in SHAP’s documentation) is the average prediction of your model across all samples in your dataset. Think of it as the "neutral starting point" the model uses before factoring in any individual features. For example, if you’re predicting customer churn and the average predicted churn probability across your data is 25%, that’s your base value.

2. What’s the Model Output in the Plot?

Each line in the decision plot ends at the final prediction for a specific individual sample. Every line tracks how the model’s prediction shifts from the base value to that sample’s unique predicted value as each feature’s SHAP impact is added in sequence.

3. Why Don’t All Lines Start at the Same Point?

Great observation—they should all originate from the base value by default! If your plot looks different, here are two common reasons:

  • You might be visualizing a subset of features. SHAP adjusts the starting point of each line to account for the combined impact of unshown features, so the plot only displays the shift caused by the features you selected.
  • Double-check if you used custom parameters like feature_order or manually set a base_value when generating the plot—these settings can alter the starting appearance.

4. Color Coding: Blue vs. Red for Feature Impact

You’re exactly right! By default in SHAP decision plots:

  • Blue represents features that push the prediction up (positive SHAP value—this feature makes the model’s output higher than the base value for that sample).
  • Red represents features that push the prediction down (negative SHAP value—this feature lowers the model’s output relative to the base value).

If you ever want to customize this, you can use the plot_color parameter when generating the plot, but blue/red for positive/negative is the standard default behavior.


内容的提问来源于stack exchange,提问作者Halan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 07:02:32