Overview
Risk stratification assigns patients to discrete risk categories (low, medium, high) based on predicted probabilities. This enables clinical teams to prioritize interventions and allocate resources effectively.Risk Band Assignment
Thestratify_risk() function converts continuous probability scores into categorical risk bands.
Basic Usage
probabilities(pd.Series): Predicted risk probabilities (0.0 to 1.0)low_threshold(float): Upper bound for low risk (default: 0.35)high_threshold(float): Lower bound for high risk (default: 0.7)
risk_probability: Original probability scorerisk_band: Categorical assignment (“low”, “medium”, “high”)
Example Output
Risk Band Logic
The stratification follows these rules:| Probability Range | Risk Band |
|---|---|
| < 0.35 | Low |
| 0.35 - 0.69 | Medium |
| ≥ 0.70 | High |
Risk Band Summary Statistics
Analyze the distribution of patients across risk categories:Clinical Use Cases
1. Triage Prioritization
2. Resource Allocation
3. Custom Thresholds
Adjust thresholds based on hospital capacity or clinical protocols:Complete Workflow Example
Interpreting Prevalence Metrics
- High Prevalence > 30%: Consider increasing capacity or adjusting thresholds
- Low Prevalence < 20%: May indicate model is too conservative
- Balanced Distribution: Typically indicates well-calibrated thresholds
Source Reference
Seemodeling/risk.py:6-25 for the complete implementation.