Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,4 +36,22 @@ if st.button("Predict disease progression score"):
|
|
| 36 |
# Directly predict: model was trained on X without extra scaler
|
| 37 |
score = lr.predict(x)[0]
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
# Directly predict: model was trained on X without extra scaler
|
| 37 |
score = lr.predict(x)[0]
|
| 38 |
|
| 39 |
+
# --- Convert score -> risk label (simple, educational thresholds) ---
|
| 40 |
+
# Typical target range in load_diabetes is about 25–350
|
| 41 |
+
if score < 120:
|
| 42 |
+
risk = "Low progression risk"
|
| 43 |
+
simple_label = "Likely NOT diabetic / low concern (for this dataset)"
|
| 44 |
+
elif score < 200:
|
| 45 |
+
risk = "Medium progression risk"
|
| 46 |
+
simple_label = "Borderline / moderate concern"
|
| 47 |
+
else:
|
| 48 |
+
risk = "High progression risk"
|
| 49 |
+
simple_label = "High concern / likely diabetic (for this dataset)"
|
| 50 |
+
|
| 51 |
+
st.success(f"Estimated disease progression score after 1 year: **{score:.2f}**")
|
| 52 |
+
st.info(f"Risk level: **{risk}**\n\nInterpretation: {simple_label}")
|
| 53 |
+
|
| 54 |
+
st.caption(
|
| 55 |
+
"⚠️ These thresholds are **for learning only** based on the sklearn dataset. "
|
| 56 |
+
"This does **not** replace real medical diagnosis."
|
| 57 |
+
)
|