Update app.py
Browse files
app.py
CHANGED
|
@@ -1012,74 +1012,119 @@ FIGSIZE = (plot_width, plot_height)
|
|
| 1012 |
st.title("Explainable-Acute-Leukemia-Mortality-Predictor")
|
| 1013 |
st.caption("Explainable clinical AI for mortality and outcome prediction in acute leukemia using SHAP-interpretable models")
|
| 1014 |
|
| 1015 |
-
with st.expander("About this
|
| 1016 |
st.markdown("""
|
| 1017 |
-
## What is this framework?
|
| 1018 |
-
|
| 1019 |
-
|
| 1020 |
-
|
| 1021 |
-
|
| 1022 |
-
|
| 1023 |
-
|
| 1024 |
-
|
| 1025 |
-
|
| 1026 |
-
|
| 1027 |
-
-
|
| 1028 |
-
|
| 1029 |
-
|
| 1030 |
-
|
| 1031 |
-
|
| 1032 |
-
|
| 1033 |
-
|
| 1034 |
-
|
| 1035 |
-
|
| 1036 |
-
|
| 1037 |
-
|
| 1038 |
-
|
| 1039 |
-
|
| 1040 |
-
|
| 1041 |
-
|
| 1042 |
-
|
| 1043 |
-
|
| 1044 |
-
|
| 1045 |
-
|
| 1046 |
-
|
| 1047 |
-
|
| 1048 |
-
|
| 1049 |
-
|
| 1050 |
-
|
| 1051 |
-
|
| 1052 |
-
|
| 1053 |
-
|
| 1054 |
-
|
| 1055 |
-
|
| 1056 |
-
|
| 1057 |
-
|
| 1058 |
-
|
| 1059 |
-
|
| 1060 |
-
|
| 1061 |
-
-
|
| 1062 |
-
|
| 1063 |
-
|
| 1064 |
-
|
| 1065 |
-
|
| 1066 |
-
|
| 1067 |
-
|
| 1068 |
-
|
| 1069 |
-
|
| 1070 |
-
|
| 1071 |
-
---
|
| 1072 |
-
|
| 1073 |
-
##
|
| 1074 |
-
|
| 1075 |
-
|
| 1076 |
-
|
| 1077 |
-
|
| 1078 |
-
|
| 1079 |
-
|
| 1080 |
-
|
| 1081 |
-
|
| 1082 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1083 |
|
| 1084 |
st.warning(
|
| 1085 |
"Prediction will fail if feature names or variable types "
|
|
|
|
| 1012 |
st.title("Explainable-Acute-Leukemia-Mortality-Predictor")
|
| 1013 |
st.caption("Explainable clinical AI for mortality and outcome prediction in acute leukemia using SHAP-interpretable models")
|
| 1014 |
|
| 1015 |
+
with st.expander("About this AI model, who can use it, and required Excel format", expanded=True):
|
| 1016 |
st.markdown("""
|
| 1017 |
+
## What is this framework?
|
| 1018 |
+
|
| 1019 |
+
This is a **clinically oriented, explainable AI platform** for developing and validating **mortality and outcome prediction models in acute leukemia** using structured Excel data.
|
| 1020 |
+
|
| 1021 |
+
The system integrates:
|
| 1022 |
+
|
| 1023 |
+
• Statistical modeling (logistic regression)
|
| 1024 |
+
• Explainable AI (SHAP)
|
| 1025 |
+
• Bootstrap internal validation
|
| 1026 |
+
• External clinical validation
|
| 1027 |
+
• Publication-ready performance reporting
|
| 1028 |
+
|
| 1029 |
+
into a **single no-code workflow** designed for clinicians and researchers.
|
| 1030 |
+
|
| 1031 |
+
The goal is to produce **transparent, trustworthy, and clinically interpretable predictions**, rather than black-box outputs.
|
| 1032 |
+
|
| 1033 |
+
---
|
| 1034 |
+
|
| 1035 |
+
## What does it do automatically?
|
| 1036 |
+
|
| 1037 |
+
After uploading your Excel file, the platform will:
|
| 1038 |
+
|
| 1039 |
+
### Model development
|
| 1040 |
+
• Train a logistic-regression–based clinical prediction model
|
| 1041 |
+
• Handle preprocessing automatically
|
| 1042 |
+
– numeric → imputation + scaling
|
| 1043 |
+
– categorical → imputation + one-hot encoding
|
| 1044 |
+
• Save the full schema to ensure reproducibility
|
| 1045 |
+
|
| 1046 |
+
### Validation
|
| 1047 |
+
• ROC AUC and ROC curves
|
| 1048 |
+
• Precision–Recall curves
|
| 1049 |
+
• Calibration curves + Brier score
|
| 1050 |
+
• Decision Curve Analysis (clinical net benefit)
|
| 1051 |
+
• Sensitivity / specificity / F1 / balanced accuracy
|
| 1052 |
+
• Threshold optimisation
|
| 1053 |
+
|
| 1054 |
+
### Internal validation (recommended)
|
| 1055 |
+
• Bootstrap out-of-bag validation (multiple resamples)
|
| 1056 |
+
• 95% confidence intervals for metrics
|
| 1057 |
+
• Reduced optimism bias for small clinical datasets
|
| 1058 |
+
|
| 1059 |
+
### Explainability
|
| 1060 |
+
• SHAP feature importance
|
| 1061 |
+
• Patient-level waterfall plots
|
| 1062 |
+
• Global and local explanations
|
| 1063 |
+
|
| 1064 |
+
### Deployment
|
| 1065 |
+
• One-click publishing of trained models
|
| 1066 |
+
• Reuse the same model on future Excel sheets
|
| 1067 |
+
• Download predictions, plots, and reports
|
| 1068 |
+
|
| 1069 |
+
All plots are exportable as **high-resolution (≥600 DPI) publication-ready figures**.
|
| 1070 |
+
|
| 1071 |
+
---
|
| 1072 |
+
|
| 1073 |
+
## Who can use this?
|
| 1074 |
+
|
| 1075 |
+
This framework is intended for:
|
| 1076 |
+
|
| 1077 |
+
• Hematology–Oncology clinicians
|
| 1078 |
+
• Clinical researchers
|
| 1079 |
+
• Epidemiologists
|
| 1080 |
+
• Outcomes researchers
|
| 1081 |
+
• Students learning explainable AI
|
| 1082 |
+
|
| 1083 |
+
No programming or machine-learning expertise is required.
|
| 1084 |
+
|
| 1085 |
+
---
|
| 1086 |
+
|
| 1087 |
+
## Required Excel format
|
| 1088 |
+
|
| 1089 |
+
### Training file (with labels)
|
| 1090 |
+
• First row must contain column names
|
| 1091 |
+
• All columns except **Outcome Event** → predictor variables
|
| 1092 |
+
• **Outcome Event** → binary label
|
| 1093 |
+
Accepted formats: 0/1, Yes/No, True/False
|
| 1094 |
+
|
| 1095 |
+
### Variable type selection
|
| 1096 |
+
During training you explicitly choose:
|
| 1097 |
+
• Numeric variables
|
| 1098 |
+
• Categorical variables
|
| 1099 |
+
|
| 1100 |
+
This schema is saved with the model and **must match future files exactly**.
|
| 1101 |
+
|
| 1102 |
+
---
|
| 1103 |
+
|
| 1104 |
+
### Prediction / External validation file
|
| 1105 |
+
Must contain:
|
| 1106 |
+
• Same predictor column names as the trained model
|
| 1107 |
+
|
| 1108 |
+
Optional:
|
| 1109 |
+
• Include **Outcome Event** to compute full external validation metrics
|
| 1110 |
+
|
| 1111 |
+
If labels are included, the system will automatically generate:
|
| 1112 |
+
• ROC
|
| 1113 |
+
• Calibration
|
| 1114 |
+
• Decision curves
|
| 1115 |
+
• Confusion matrix
|
| 1116 |
+
• Clinical performance metrics
|
| 1117 |
+
|
| 1118 |
+
---
|
| 1119 |
+
|
| 1120 |
+
## Important note
|
| 1121 |
+
|
| 1122 |
+
This tool is for **research and decision-support only**.
|
| 1123 |
+
It is **not a medical device** and must not replace clinical judgment.
|
| 1124 |
+
""")
|
| 1125 |
+
|
| 1126 |
+
|
| 1127 |
+
|
| 1128 |
|
| 1129 |
st.warning(
|
| 1130 |
"Prediction will fail if feature names or variable types "
|