Spaces:
Runtime error
Runtime error
Hope-Liang
commited on
Commit
•
17a6de7
1
Parent(s):
fe65d04
update
Browse files
app.py
CHANGED
@@ -27,15 +27,15 @@ def titanic(pclass, sex, age, sibsp, parch, fare, embarked):
|
|
27 |
else:
|
28 |
print("ERROR!")
|
29 |
exit()
|
30 |
-
if embarked
|
31 |
input_list.append(1.0)
|
32 |
input_list.append(0.0)
|
33 |
input_list.append(0.0)
|
34 |
-
elif embarked
|
35 |
input_list.append(0.0)
|
36 |
input_list.append(1.0)
|
37 |
input_list.append(0.0)
|
38 |
-
elif embarked
|
39 |
input_list.append(0.0)
|
40 |
input_list.append(0.0)
|
41 |
input_list.append(1.0)
|
@@ -70,12 +70,12 @@ demo = gr.Interface(
|
|
70 |
description="Experiment with titanic passenger features to predict whether survived or not.",
|
71 |
allow_flagging="never",
|
72 |
inputs=[
|
73 |
-
gr.inputs.Number(default=1, label="Pclass (1,2,3)")
|
74 |
gr.inputs.Textbox(default="female", label="Sex (female/male)"),
|
75 |
gr.inputs.Number(default=30.0, label="age (years)"),
|
76 |
gr.inputs.Number(default=1.0, label="SibSp"),
|
77 |
gr.inputs.Number(default=1.0, label="Parch"),
|
78 |
-
gr.inputs.Number(default=10.0, label="Fare (GBP)")
|
79 |
gr.inputs.Textbox(default="S", label="Embarked (S,C,Q)")
|
80 |
],
|
81 |
outputs=gr.Image(type="pil"))
|
|
|
27 |
else:
|
28 |
print("ERROR!")
|
29 |
exit()
|
30 |
+
if embarked == "C":
|
31 |
input_list.append(1.0)
|
32 |
input_list.append(0.0)
|
33 |
input_list.append(0.0)
|
34 |
+
elif embarked == "Q":
|
35 |
input_list.append(0.0)
|
36 |
input_list.append(1.0)
|
37 |
input_list.append(0.0)
|
38 |
+
elif embarked == "S":
|
39 |
input_list.append(0.0)
|
40 |
input_list.append(0.0)
|
41 |
input_list.append(1.0)
|
|
|
70 |
description="Experiment with titanic passenger features to predict whether survived or not.",
|
71 |
allow_flagging="never",
|
72 |
inputs=[
|
73 |
+
gr.inputs.Number(default=1, label="Pclass (1,2,3)"),
|
74 |
gr.inputs.Textbox(default="female", label="Sex (female/male)"),
|
75 |
gr.inputs.Number(default=30.0, label="age (years)"),
|
76 |
gr.inputs.Number(default=1.0, label="SibSp"),
|
77 |
gr.inputs.Number(default=1.0, label="Parch"),
|
78 |
+
gr.inputs.Number(default=10.0, label="Fare (GBP)"),
|
79 |
gr.inputs.Textbox(default="S", label="Embarked (S,C,Q)")
|
80 |
],
|
81 |
outputs=gr.Image(type="pil"))
|