|
| 1 | +# Reference Implementations |
| 2 | + |
| 3 | +Open-source reference modules for the statistical and ML methods Upstream uses in production. All modules use public CMS data only — no PHI, no proprietary payer data, no production model weights. |
| 4 | + |
| 5 | +## Modules |
| 6 | + |
| 7 | +| Module | What it demonstrates | |
| 8 | +|---|---| |
| 9 | +| `aba_auth_predictor.py` | Gradient-boosting prior auth approval prediction for ABA therapy. Temporal cross-validation. | |
| 10 | +| `carc_rarc_utils.py` | CARC/RARC denial code registry from public CMS lists. Lookup, classification, severity scoring. | |
| 11 | +| `denial_clustering.py` | K-means clustering of denial patterns using CARC codes. Chi-square baseline comparison for industry signal detection. | |
| 12 | +| `denial_prediction_reference.py` | CatBoost denial prediction with temporal cross-validation and SHAP explainability. The core methodology Upstream uses in production. | |
| 13 | +| `dental_denial_clustering.py` | CDT-code cluster detection for dental billing. Downcoding, bundling, and frequency-limit pattern detection. | |
| 14 | +| `drift_detection_reference.py` | Payer behavioral drift detection — the core signal that Upstream's DriftWatch engine is built on. Chi-square + Kolmogorov-Smirnov tests. | |
| 15 | +| `payer_behavior_detector.py` | Statistical detection of payer adjudication shifts. Chi-square for categorical changes (denial rate by CARC code). | |
| 16 | + |
| 17 | +## Methodology vs. weights |
| 18 | + |
| 19 | +These reference modules show **how** Upstream detects payer behavior changes. They do not include production model weights, payer-specific training data, or any PHI. To use the methodology with your own data, follow the notebooks in `../notebooks/` for end-to-end walkthroughs. |
| 20 | + |
| 21 | +## Running locally |
| 22 | + |
| 23 | +```bash |
| 24 | +# From the repo root |
| 25 | +pip install -r requirements.txt |
| 26 | + |
| 27 | +# Run a single module |
| 28 | +python -m reference.denial_prediction_reference |
| 29 | + |
| 30 | +# Or import in a notebook |
| 31 | +from reference.drift_detection_reference import detect_drift |
| 32 | +``` |
| 33 | + |
| 34 | +## Contributing |
| 35 | + |
| 36 | +Add new reference implementations that demonstrate methodology with public data. See the org-wide `CONTRIBUTING.md` and the `upstream-community` repo `CONTRIBUTING.md` for the contribution model. |
| 37 | + |
| 38 | +PHI in any contribution will be rejected. Synthetic data only. Document your data source in any new module. |
0 commit comments