Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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[
|
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"),
|