fromcarlostocosta commited on
Commit
ef67739
1 Parent(s): 83860b0

Add survival probability

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -41,6 +41,7 @@ passenger_data = {
41
  passenger_data_df = pd.DataFrame.from_dict([passenger_data])
42
 
43
  prediction = model.predict(passenger_data_df)[0]
 
44
 
45
  if prediction == 0:
46
  st.markdown("# YOU'RE DEAD :cry:")
@@ -49,4 +50,6 @@ elif sex == "Male":
49
  st.markdown("# YOU MADE IT, :man-swimming:")
50
 
51
  else:
52
- st.markdown("# YOU MADE IT, :woman-swimming:")
 
 
 
41
  passenger_data_df = pd.DataFrame.from_dict([passenger_data])
42
 
43
  prediction = model.predict(passenger_data_df)[0]
44
+ prediction_proba = model.predict_proba(passenger_data_df)[:,1][0]
45
 
46
  if prediction == 0:
47
  st.markdown("# YOU'RE DEAD :cry:")
 
50
  st.markdown("# YOU MADE IT, :man-swimming:")
51
 
52
  else:
53
+ st.markdown("# YOU MADE IT, :woman-swimming:")
54
+
55
+ st.write(f"Probabilty of survival {round(prediction_proba, 2)* 100}%.")