lucasilvap commited on
Commit
5c6d46e
·
verified ·
1 Parent(s): 142d97c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,9 +4,9 @@ import joblib as jb
4
  def predict(sex, age, pclass):
5
  model = jb.load("model.pkl")
6
  pclass = int(pclass)
7
- p = model.predict_proba([sex, age, pclass])[0]
8
 
9
- return {"Did not survive": p[1], "Survived": p[0]}
10
 
11
  demo = gr.Interface(fn=predict,
12
  inputs=[gr.Dropdown(choices=["male", "female"], type="index"),
 
4
  def predict(sex, age, pclass):
5
  model = jb.load("model.pkl")
6
  pclass = int(pclass)
7
+ p = model.predict_proba([[sex, age, pclass]])[0]
8
 
9
+ return {"Did not survive": p[0], "Survived": p[1]}
10
 
11
  demo = gr.Interface(fn=predict,
12
  inputs=[gr.Dropdown(choices=["male", "female"], type="index"),