Built with Streamlit, Plotly, Pandas, and Joblib
The Asclepios Treatment Intelligence app is an interactive Streamlit application designed to provide AI-driven predictions for substance-use treatment patients.
The system loads pre-trained ML models (High-Risk Prediction + Length-of-Stay Predictors) and generates:
- High-risk admission likelihood
- Detox length-of-stay (LOS) prediction
- Rehab length-of-stay (LOS) prediction
- Patient risk insights & feature-engineered scores
- Interactive UI with professional medical-themed styling
This application is ideal for clinical researchers, treatment facilities, and data-science practitioners exploring applied predictive healthcare analytics.
- High-risk treatment prediction
- Estimated Length-of-Stay (Detox + Rehab)
- Advanced feature engineering:
- Years using substance
- SDOH Score
- Risk synergy indicators
- Acuity scoring
- Legal mandate flag
- MAT (methadone) maintenance flag
- Fully customized Streamlit theme
- Styled headers, cards, tabs, buttons
- Sidebar navigation
- Risk badges & visual cues
- Gradient backgrounds and shadow effects
The application loads saved models via:
../models/model_high_risk.pkl
../models/asclepios_los_detox.pkl
../models/asclepios_los_rehab.pkl
../models/model_features_high_risk.pkl
../models/model_features_los.pkl
5_communication_strategy/
|
|── Streamlit/
│ ├── app.py # Streamlit app
│── models/
│ ├── model_high_risk.pkl
│ ├── asclepios_los_detox.pkl
│ ├── asclepios_los_rehab.pkl
│ ├── model_features_high_risk.pkl
│ └── model_features_los.pkl
│── README.md
The app uses @st.cache_resource to efficiently load trained models:
models = {
"high risk": joblib.load("../models/model_high_risk.pkl"),
"detox los": joblib.load("../models/asclepios_los_detox.pkl"),
"rehab los": joblib.load("../models/asclepios_los_rehab.pkl"),
"features high risk": joblib.load("../models/model_features_high_risk.pkl"),
"features los": joblib.load("../models/model_features_los.pkl"),
}The app builds clinical-grade engineered features, including:
- Years_Using_Substance
- SDOH_Score
- Risk synergy features
- Acuity scoring
- MAT maintenance
- Legal mandate flag
These are dynamically computed from user inputs.
The render_prediction_interface() function:
- Collects patient inputs via Streamlit UI
- Generates patient profile badges
- Builds a prediction dataframe
- Runs ML models
- Displays results with styled metrics and insight cards
Main interactive page:
- Demographics
- Clinical input
- Substance history
- Social factors
- Prediction results
displays analytic charts or model information
Project description and usage details.
pip install streamlit pandas plotly joblibstreamlit run app.pyEnsure the models/ directory exists and contains the .pkl model
files.
- Age
- Sex
- Race
- Education
- Marital Status
- Treatment Service Type
- Psychiatric Problems
- Methadone Usage
- Primary Substance + Route + Frequency
- Age First Use
- Secondary/Tertiary Substances
- Prior Treatments
- DSM Criteria
- Employment
- Living Conditions
- Arrests
- Referral Source
- State FIPS
- Insurance
The app uses 200+ lines of handcrafted CSS to transform Streamlit UI components:
- Cards
- Buttons
- Tabs
- Metrics
- Badges
- Progress bars
- Sidebar
- Input fields
Brand colors used:
#764e7e
#1A2A4F
#F87B1B
#F7A5A5
This project is for research and educational purposes.
Modify freely but ensure dataset and model usage comply with privacy and
ethical guidelines.
Bhang (Wuor Bhang)
Rafaa Ali
Caesar Ghazi
Moe Alwathiq
MIT Emerging Talent • Data Scientist
AI/ML Healthcare & Treatment Analytics Researcher
