Commit
·
27db1e5
1
Parent(s):
f6ca482
Add interactive predictor.
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import marimo
|
| 2 |
|
| 3 |
-
__generated_with = "0.11.
|
| 4 |
app = marimo.App(width="medium")
|
| 5 |
|
| 6 |
|
|
@@ -131,6 +131,40 @@ def _(X_test_priors, pl, y_pred_priors, y_test_priors):
|
|
| 131 |
)
|
| 132 |
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
@app.cell
|
| 135 |
def _():
|
| 136 |
return
|
|
|
|
| 1 |
import marimo
|
| 2 |
|
| 3 |
+
__generated_with = "0.11.6"
|
| 4 |
app = marimo.App(width="medium")
|
| 5 |
|
| 6 |
|
|
|
|
| 131 |
)
|
| 132 |
|
| 133 |
|
| 134 |
+
@app.cell
|
| 135 |
+
def _(mo):
|
| 136 |
+
mo.md(r"""# Diabetes Predictor""")
|
| 137 |
+
return
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
@app.cell
|
| 141 |
+
def _(mo):
|
| 142 |
+
priors_predict = mo.md(
|
| 143 |
+
'''
|
| 144 |
+
Do you suffer from?
|
| 145 |
+
|
| 146 |
+
* {high_bp} - High Blood Pressure
|
| 147 |
+
* {high_chol} - High Cholesterol
|
| 148 |
+
* {stroke} - Stroke
|
| 149 |
+
* {heart_disease_or_attack} - Heart Disease or Attack
|
| 150 |
+
'''
|
| 151 |
+
).batch(high_bp=mo.ui.checkbox(), high_chol=mo.ui.checkbox(), stroke=mo.ui.checkbox(), heart_disease_or_attack=mo.ui.checkbox())
|
| 152 |
+
priors_predict
|
| 153 |
+
return (priors_predict,)
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
@app.cell
|
| 157 |
+
def _(bnb, mo, priors_predict):
|
| 158 |
+
diabetes_or_not = bool(bnb.predict([[i.value for i in priors_predict.values()],]))
|
| 159 |
+
prediction = None
|
| 160 |
+
if diabetes_or_not:
|
| 161 |
+
prediction = mo.md("Diabetes").callout(kind="danger")
|
| 162 |
+
else:
|
| 163 |
+
prediction = mo.md("No Diabetes").callout(kind="success")
|
| 164 |
+
prediction
|
| 165 |
+
return diabetes_or_not, prediction
|
| 166 |
+
|
| 167 |
+
|
| 168 |
@app.cell
|
| 169 |
def _():
|
| 170 |
return
|