> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allyy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Regression SHAP

> Model Explainability (SHAP Insights) (Regression Model)

The Model Explainability section provides transparency into how the model arrives at its predictions. By utilizing SHAP (SHapley Additive exPlanations) values, the platform breaks down global feature importance, granular feature behavior, and individual prediction logic.

<Note>
  **Note on Model Types:** The explainability logic remains identical whether you are evaluating a Classification model (predicting a probability/likelihood) or a Regression model (predicting a financial value/amount). The only difference is the unit of the output scale.
</Note>

## Global Feature Importance

<Tabs>
  <Tab title="Global Feature Importance">
    <img src="https://mintlify.s3.us-west-1.amazonaws.com/allyyio/images/Screenshot%202026-07-10%20at%2014.29.32.png" alt="Globa Feature Importance" />
  </Tab>
</Tabs>

This chart ranks the model’s variables based on their overall impact on predictions across the entire holdout dataset.

The bar chart displays the mean absolute SHAP value for each feature. The longer the bar, the more influential that specific variable is when the model calculates a prediction.

### What this chart tells the user

* **Primary Drivers:** The top-ranked features represent the most critical data points for the model. For instance, dm\_h\_avg\_pos\_amount (historical average positive donation amount) acts as a major anchor for decision-making.
* **Interpretation by Business Case:**
  * In Classification: A long bar means this feature heavily dictates whether a user's probability of responding or converting shifts up or down.
  * In Regression (e.g., DM Expected Amount): A long bar means this feature heavily dictates the predicted donation amount assigned to a donor.
* **The Long Tail of Data:** The "Sum of 156 other features" at the bottom highlights that while individual secondary features have smaller impacts, their cumulative signal provides an essential layer of model refinement (+0.31 impact).

***

## Feature Impact and Directional Behavior (Beeswarm)

<Tabs>
  <Tab title="Feature Impact and Directional Behavior (Beeswarm)">
    <img src="https://mintlify.s3.us-west-1.amazonaws.com/allyyio/images/Screenshot%202026-07-14%20at%2012.09.13.png" alt="Feature Impact and Directional Behavior" />
  </Tab>
</Tabs>

This chart combines feature importance with directional impact, showing not just which features matter, but how high or low values of those features push the model's final prediction score.

Each dot represents a single individual in the holdout dataset.

* **Vertical Position:** Groups the dots by feature (ordered from most important at the top to least important).
* **Horizontal Position (X-axis):** Shows the SHAP value. Points to the right of the center line (0.0) indicate a positive impact (increasing the model score); points to the left indicate a negative impact.
* **Color Scale:** Represents the actual value of the feature for that individual (Red = High value, Blue = Low value).

### What this chart tells the user

* **Positive Correlations (Red on the Right):** For features like Age, the red cluster sits on the right side.
  * **Classification Example:** High historical donation values (red dots) push the score to the right, meaning a higher probability of conversion or retention.
  * **Regression Example:** High historical donation values (red dots) push the score to the right, meaning the model will predict a higher expected donation amount for this campaign.
* **Negative Correlations (Red on the Left / Blue on the Right):** For features where blue clusters push to the right, lower raw values provide a stronger lift to the prediction score (e.g., fewer days since the last transaction meaning higher current engagement).
* **Density and Outliers:** The thickness of the "swarms" indicates how common a specific behavior is across the dataset, helping users spot whether a feature affects the majority of the audience or just a select few outliers.

***

## Feature Dependence Analysis

<Tabs>
  <Tab title="Feature Dependence Analysis">
    <img src="https://mintlify.s3.us-west-1.amazonaws.com/allyyio/images/Screenshot%202026-07-10%20at%2014.29.52.png" alt="Feature Dependence Analysis" />
  </Tab>
</Tabs>

This scatter plot isolates a single key feature to map exactly how its raw values translate into model impact (SHAP values). This view helps users detect non-linear relationships, step-functions, or saturation thresholds in the model’s logic.

The x-axis displays the actual raw value of the selected feature (e.g., dm\_h\_avg\_pos\_amount). The y-axis displays the resulting SHAP value (impact on model output). Each dot represents one individual from the holdout dataset.

### What this chart tells the user

* **Clear Response Thresholds:** The distinct upward curve and subsequent plateau reveal specific inflection points where the model changes how it values a donor based on their historical behavior.
* **Dual-Case Interpretation:**
  * **Classification Context:** As the feature value increases past 1.0, the SHAP value climbs toward +0.75, adding a massive boost to the individual's likelihood to respond to direct mail.
  * **Regression Context:** That same jump past 1.0 translates directly into a baseline increase in the expected gift amount calculated for that profile.
* **Diminishing Returns & Saturation:** Users can observe where the curve flattens out (e.g., between 1.5 and 2.0). If the SHAP value stops rising after a certain threshold on the x-axis, it indicates that increasing the feature value beyond that point yields no additional predictive lift.

***

## Individual Prediction Breakdown (Waterfall)

<Tabs>
  <Tab title="Individual Prediction Breakdown (Waterfall)">
    <img src="https://mintlify.s3.us-west-1.amazonaws.com/allyyio/images/Screenshot%202026-07-10%20at%2014.30.06.png" alt="Individual Prediction Breakdown" />
  </Tab>
</Tabs>

The Waterfall chart moves from global patterns to a hyper-local view, detailing exactly why a single specific sample or individual received their final score. It functions as a digital "receipt" for an individual prediction.

* $E[f(x)]$ **(Baseline):** The starting value at the bottom represents the average prediction score across the entire dataset before looking at this individual's specific data (here, 3.114).
* $f(x)$ **(Final Score):** The value at the top represents this specific individual's final predicted score (here, 3.385).
* **Colored Bars:**
  * Red Bars (+): Factors that increased this individual's score above the baseline.
  * Blue Bars (-): Factors that dragged this individual's score down.

### What this chart tells the user

* **The Winning/Losing Attributes:** It allows users to pinpoint the exact "tipping points" for an individual profile.
  * **Classification Application:** In this sample, a positive average historical donation amount dragged up the score by +0.26 (increasing their conversion probability), while a long time since the last interaction (-0.16) pulled the probability back down.
  * **Regression Application:** In an amount-destination model, the baseline expectation might be a log-transformed value of 3.114. High average positive amounts (+0.26) and strong cumulative campaign counts (+0.21) scale up the final expected dollar value, while negative blue attributes drag the expected gift size down to its final position at 3.385.
* **Operational Transparency:** This level of granularity is highly valuable for customer success teams or campaign managers who need to understand the precise mix of behavioral history that qualified or disqualified a specific high-value segment.
