Update app.py
Browse files
app.py
CHANGED
|
@@ -23,10 +23,6 @@ logged_model = 'runs:/a45156c210f149b2abbfe15e5b824cc4/model'
|
|
| 23 |
# Load model as a PyFuncModel.
|
| 24 |
loaded_model = mlflow.pyfunc.load_model(logged_model)
|
| 25 |
|
| 26 |
-
@st.cache_data
|
| 27 |
-
def convert_df(df):
|
| 28 |
-
return df.to_csv(index=False).encode('utf-8')
|
| 29 |
-
|
| 30 |
def run():
|
| 31 |
# init
|
| 32 |
st.set_page_config(page_title="Loan Default Prediction App")
|
|
@@ -36,13 +32,13 @@ def run():
|
|
| 36 |
if uploaded_file is not None:
|
| 37 |
# do prediction
|
| 38 |
data = pd.read_csv(uploaded_file)
|
| 39 |
-
prediction = loaded_model.predict(data
|
| 40 |
|
| 41 |
# show the result
|
| 42 |
st.write(prediction)
|
| 43 |
|
| 44 |
# download the result
|
| 45 |
-
# csv =
|
| 46 |
# if st.download_button('Download Prediction', csv, 'prediction.csv'):
|
| 47 |
# st.write('Thanks for downloading!')
|
| 48 |
|
|
|
|
| 23 |
# Load model as a PyFuncModel.
|
| 24 |
loaded_model = mlflow.pyfunc.load_model(logged_model)
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
def run():
|
| 27 |
# init
|
| 28 |
st.set_page_config(page_title="Loan Default Prediction App")
|
|
|
|
| 32 |
if uploaded_file is not None:
|
| 33 |
# do prediction
|
| 34 |
data = pd.read_csv(uploaded_file)
|
| 35 |
+
prediction = loaded_model.predict(data)
|
| 36 |
|
| 37 |
# show the result
|
| 38 |
st.write(prediction)
|
| 39 |
|
| 40 |
# download the result
|
| 41 |
+
# csv = prediction.to_csv(index=False).encode('utf-8')
|
| 42 |
# if st.download_button('Download Prediction', csv, 'prediction.csv'):
|
| 43 |
# st.write('Thanks for downloading!')
|
| 44 |
|