mnurbani commited on
Commit
f390e4b
1 Parent(s): 3597611

Update prediction.py

Browse files
Files changed (1) hide show
  1. prediction.py +17 -5
prediction.py CHANGED
@@ -84,11 +84,23 @@ def run():
84
  #Logic ketika predic button ditekan
85
 
86
  if submitted:
87
-
88
- #predict using pipe rf model
89
- predictions = loaded_model.predict(data_inf)
90
-
91
- st.write('## Deposit : ', str(int(predictions)))
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
  if __name__ == '__main__':
94
  run()
 
84
  #Logic ketika predic button ditekan
85
 
86
  if submitted:
87
+
88
+ # Predict using loaded model
89
+ predictions = loaded_model.predict(data_inf)
90
+
91
+ # Menampilkan data input
92
+ st.write('## Data Input:')
93
+ st.dataframe(data_inf)
94
+
95
+ # Menampilkan hasil prediksi
96
+ st.write('## Hasil Prediksi:')
97
+ st.write('Deposit:', int(predictions[0]))
98
+
99
+ # Menampilkan pesan berdasarkan hasil prediksi
100
+ if predictions[0] == 0:
101
+ st.write("Nasabah belum berlangganan deposito berjangka.")
102
+ else:
103
+ st.write("Nasabah telah berlangganan deposito berjangka.")
104
 
105
  if __name__ == '__main__':
106
  run()