Update prediction.py
Browse files- __pycache__/eda.cpython-310.pyc +0 -0
- __pycache__/prediction.cpython-310.pyc +0 -0
- eda.py +3 -1
- prediction.py +8 -6
__pycache__/eda.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/eda.cpython-310.pyc and b/__pycache__/eda.cpython-310.pyc differ
|
|
|
__pycache__/prediction.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/prediction.cpython-310.pyc and b/__pycache__/prediction.cpython-310.pyc differ
|
|
|
eda.py
CHANGED
|
@@ -6,7 +6,9 @@ import plotly.express as px
|
|
| 6 |
from PIL import Image
|
| 7 |
|
| 8 |
st.set_page_config(
|
| 9 |
-
page_title="
|
|
|
|
|
|
|
| 10 |
)
|
| 11 |
|
| 12 |
# dataset
|
|
|
|
| 6 |
from PIL import Image
|
| 7 |
|
| 8 |
st.set_page_config(
|
| 9 |
+
page_title="Heart Failure Classification",
|
| 10 |
+
layout="wide",
|
| 11 |
+
initial_sidebar_state="expanded",
|
| 12 |
)
|
| 13 |
|
| 14 |
# dataset
|
prediction.py
CHANGED
|
@@ -65,10 +65,9 @@ def run():
|
|
| 65 |
)
|
| 66 |
sc = col1.number_input(
|
| 67 |
"Serum Creatinine",
|
| 68 |
-
min_value=0,
|
| 69 |
-
max_value=100,
|
| 70 |
value=1.75,
|
| 71 |
-
step=1e-3,
|
| 72 |
help="mg/dL",
|
| 73 |
)
|
| 74 |
time = col2.number_input(
|
|
@@ -100,13 +99,16 @@ def run():
|
|
| 100 |
if submitted:
|
| 101 |
y_pred_inf = model_pipeline.predict(data_inf)
|
| 102 |
st.write("# Classification Results:")
|
| 103 |
-
|
|
|
|
| 104 |
st.write(
|
| 105 |
-
"Pasien diprediksi akan meninggal dunia, segera hubungi dokter atau tenaga medis"
|
|
|
|
| 106 |
)
|
| 107 |
else:
|
| 108 |
st.write(
|
| 109 |
-
"Pasien
|
|
|
|
| 110 |
)
|
| 111 |
|
| 112 |
|
|
|
|
| 65 |
)
|
| 66 |
sc = col1.number_input(
|
| 67 |
"Serum Creatinine",
|
| 68 |
+
min_value=0.0,
|
| 69 |
+
max_value=100.0,
|
| 70 |
value=1.75,
|
|
|
|
| 71 |
help="mg/dL",
|
| 72 |
)
|
| 73 |
time = col2.number_input(
|
|
|
|
| 99 |
if submitted:
|
| 100 |
y_pred_inf = model_pipeline.predict(data_inf)
|
| 101 |
st.write("# Classification Results:")
|
| 102 |
+
|
| 103 |
+
if y_pred_inf[0] == 1:
|
| 104 |
st.write(
|
| 105 |
+
"### Pasien diprediksi akan meninggal dunia, <span style='color:red;'> segera hubungi dokter atau tenaga medis </span>",
|
| 106 |
+
unsafe_allow_html=True,
|
| 107 |
)
|
| 108 |
else:
|
| 109 |
st.write(
|
| 110 |
+
"### Pasien tidak diprediksi meninggal dunia,<span style='color:green;'> untuk konsultasi lebih lanjut, hubungi dokter atau tenaga medis </span>",
|
| 111 |
+
unsafe_allow_html=True,
|
| 112 |
)
|
| 113 |
|
| 114 |
|