Skip to content

Commit 4db9169

Browse files
committed
Improve MSD history diagram with clearer flow and explanation
1 parent ed5ad79 commit 4db9169

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

docs/marginal_somersd_guide.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,29 @@ Features are automatically penalized if redundant—they can't rank residuals we
135135

136136
```mermaid
137137
graph TD
138-
Total[Total Variance in y<br/>100%] --> Step1{Step 1<br/>Time_with_Bank}
139-
Step1 -->|Explained<br/>~64%| Explained1[Captured Variance]
140-
Step1 -->|Residual<br/>~36%| Residual1[Remaining Variance]
141-
Residual1 --> Step2{Step 2<br/>Age_of_Applicant}
142-
Step2 -->|Explained<br/>~13% of residual| Explained2[Additional Variance]
143-
Step2 -->|Residual<br/>~23%| Residual2[Still Remaining]
144-
Residual2 --> Step3[Steps 3+<br/>Diminishing returns]
145-
style Explained1 fill:#4caf50
146-
style Explained2 fill:#8bc34a
147-
style Residual2 fill:#ffeb3b
138+
Start[Target: y] --> Step1[Step 1: Time_with_Bank<br/>Univariate Somers' D = 0.64]
139+
Step1 --> Model1[Fit model with 1 feature]
140+
Model1 --> Resid1[Compute residuals:<br/>epsilon1 = y - y_hat1]
141+
Resid1 --> Step2[Step 2: Age_of_Applicant<br/>MSD with residuals = 0.13]
142+
Step2 --> Model2[Fit model with 2 features]
143+
Model2 --> Resid2[Compute residuals:<br/>epsilon2 = y - y_hat2]
144+
Resid2 --> Step3[Steps 3+<br/>MSD ≈ 0.07-0.19<br/>Diminishing returns]
145+
style Step1 fill:#e1f5ff
146+
style Resid1 fill:#fff4e1
147+
style Step2 fill:#e8f5e9
148+
style Resid2 fill:#fff4e1
148149
style Step3 fill:#e0e0e0
149150
```
150151

151152
MSD values typically show this pattern:
152153

153-
- **Step 1**: High (e.g., 0.64) - univariate correlation with target
154-
- **Step 2**: Sharp drop (e.g., 0.13) - now measuring against residuals
155-
- **Step 3+**: Gradual decrease (e.g., 0.07-0.19) - diminishing residual variance
154+
- **Step 1**: High (e.g., 0.64) - univariate Somers' D with target
155+
- **Step 2**: Sharp drop (e.g., 0.13) - measuring against residuals instead
156+
- **Step 3+**: Gradual decrease (e.g., 0.07-0.19) - less residual variance to explain
157+
158+
**This drop is expected and correct.** Step 1 measures correlation with the original target. From Step 2 onwards, MSD measures correlation with residuals—what the current model doesn't explain. Since residuals are smaller and have different distributions than the original target, MSD values are naturally lower.
156159

157-
**This drop is expected and correct.** After the first feature explains most variance, subsequent features only capture what remains. Slight increases indicate a feature found orthogonal information.
160+
**Why values aren't additive**: Somers' D is a rank correlation measure, not a variance proportion. You cannot add 0.64 + 0.13 to get total model performance. Instead, evaluate the final model's overall Somers' D on held-out data.
158161

159162
Feature correlation is computed as:
160163

0 commit comments

Comments
 (0)