Shafanda Nabil Sembodo commited on
Commit
06c371b
·
1 Parent(s): 7f5ad9a
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -32,13 +32,15 @@ def prediction():
32
  df = pd.read_csv(uploaded_file)
33
  model = load_model()
34
  prediction = predict_model(model, df).drop(columns='Unnamed: 0')
 
 
 
35
 
36
- # show the result
37
- st.write(prediction)
38
 
39
- # download the result
40
- csv = convert_df(prediction)
41
- if st.download_button('Download Prediction', csv, 'prediction.csv'):
42
- st.write('Thanks for downloading!')
43
 
44
- prediction()
 
32
  df = pd.read_csv(uploaded_file)
33
  model = load_model()
34
  prediction = predict_model(model, df).drop(columns='Unnamed: 0')
35
+ return prediction
36
+
37
+ result = prediction()
38
 
39
+ # show the result
40
+ st.write(result)
41
 
42
+ # download the result
43
+ csv = convert_df(result)
44
+ if st.download_button('Download Prediction', csv, 'prediction.csv'):
45
+ st.write('Thanks for downloading!')
46