Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
|
|
3 |
import joblib
|
4 |
import matplotlib.pyplot as plt
|
5 |
import time
|
|
|
6 |
|
7 |
# Load the pre-trained numerical imputer, scaler, and model using joblib
|
8 |
num_imputer = joblib.load('numerical_imputer.joblib')
|
@@ -101,6 +102,12 @@ def main():
|
|
101 |
st.markdown(f"Prediction: **{prediction_text}**")
|
102 |
st.markdown(f"{status_icon} {sepsis_explanation}")
|
103 |
st.write(output_df)
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
|
106 |
# Plot the probabilities
|
|
|
3 |
import joblib
|
4 |
import matplotlib.pyplot as plt
|
5 |
import time
|
6 |
+
import base
|
7 |
|
8 |
# Load the pre-trained numerical imputer, scaler, and model using joblib
|
9 |
num_imputer = joblib.load('numerical_imputer.joblib')
|
|
|
102 |
st.markdown(f"Prediction: **{prediction_text}**")
|
103 |
st.markdown(f"{status_icon} {sepsis_explanation}")
|
104 |
st.write(output_df)
|
105 |
+
|
106 |
+
# Add a download button for output_df
|
107 |
+
csv = output_df.to_csv(index=False)
|
108 |
+
b64 = base64.b64encode(csv.encode()).decode()
|
109 |
+
href = f'<a href="data:file/csv;base64,{b64}" download="output.csv">Download Output CSV</a>'
|
110 |
+
st.markdown(href, unsafe_allow_html=True)
|
111 |
|
112 |
|
113 |
# Plot the probabilities
|