sihar commited on
Commit
4350ab2
1 Parent(s): fc73154

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
app.py CHANGED
@@ -39,11 +39,23 @@ data = pd.DataFrame({'age': [age],
39
 
40
  data = preproses.transform(data)
41
  # model predict
42
- death = model.predict(data).tolist()[0]
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  # interpretation
45
- st.write('Predition Result: ')
46
- if death == 0:
47
- st.text('live')
48
- else:
49
- st.text('Death')
 
39
 
40
  data = preproses.transform(data)
41
  # model predict
42
+
43
+ if st.button('Predict'):
44
+ prediction = model.predict(data).tolist()[0]
45
+
46
+ if prediction == 1:
47
+ prediction = 'Death'
48
+ else:
49
+ prediction = 'Live'
50
+
51
+ st.write('Based on user input, predicted: ')
52
+
53
+
54
+
55
 
56
  # interpretation
57
+ # st.write('Predition Result: ')
58
+ # if death == 0:
59
+ # st.text('live')
60
+ # else:
61
+ # st.text('Death')