Spaces:
Runtime error
Runtime error
Campfireman
commited on
Commit
•
3cf0c60
1
Parent(s):
c1552b6
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ model = mr.get_model("titanic_modal_more_specs_grad_boosted", version=1)
|
|
14 |
model_dir = model.download()
|
15 |
model = joblib.load(model_dir + "/titanic_model.pkl")
|
16 |
|
17 |
-
def titanic(pclass,sex,age,sibsp,parch,embarked,fare_per_customer,
|
18 |
input_list = []
|
19 |
input_list.append(pclass)
|
20 |
input_list.append(sex)
|
@@ -23,12 +23,11 @@ def titanic(pclass,sex,age,sibsp,parch,embarked,fare_per_customer,embarked_remap
|
|
23 |
input_list.append(parch)
|
24 |
input_list.append(embarked)
|
25 |
input_list.append(fare_per_customer)
|
26 |
-
input_list.append(
|
27 |
-
input_list.append(cabin_remapped)
|
28 |
# 'res' is a list of predictions returned as the label.
|
29 |
#global res
|
30 |
res = model.predict(np.asarray(input_list).reshape(1, -1))
|
31 |
-
return
|
32 |
|
33 |
demo = gr.Interface(
|
34 |
titanic,
|
@@ -36,13 +35,13 @@ demo = gr.Interface(
|
|
36 |
description="Predict survivals. 0 for dead and 1 for survived. ",
|
37 |
inputs=[
|
38 |
gr.inputs.Number(default=1.0, label="pclass"),
|
39 |
-
gr.inputs.Number(default=1.0, label="gender
|
40 |
gr.inputs.Number(default=1.0, label="age"),
|
41 |
gr.inputs.Number(default=1.0, label="sibsp"),
|
42 |
gr.inputs.Number(default=1.0, label="parch"),
|
43 |
-
gr.inputs.Number(default=1.0, label="embarked
|
44 |
gr.inputs.Number(default=1.0, label="fare_per_customer"),
|
45 |
-
gr.inputs.Number(default=1.0, label="cabin
|
46 |
],
|
47 |
outputs=gr.Textbox()
|
48 |
)
|
|
|
14 |
model_dir = model.download()
|
15 |
model = joblib.load(model_dir + "/titanic_model.pkl")
|
16 |
|
17 |
+
def titanic(pclass,sex,age,sibsp,parch,embarked,fare_per_customer,cabin):
|
18 |
input_list = []
|
19 |
input_list.append(pclass)
|
20 |
input_list.append(sex)
|
|
|
23 |
input_list.append(parch)
|
24 |
input_list.append(embarked)
|
25 |
input_list.append(fare_per_customer)
|
26 |
+
input_list.append(cabin)
|
|
|
27 |
# 'res' is a list of predictions returned as the label.
|
28 |
#global res
|
29 |
res = model.predict(np.asarray(input_list).reshape(1, -1))
|
30 |
+
return "This guy will"
|
31 |
|
32 |
demo = gr.Interface(
|
33 |
titanic,
|
|
|
35 |
description="Predict survivals. 0 for dead and 1 for survived. ",
|
36 |
inputs=[
|
37 |
gr.inputs.Number(default=1.0, label="pclass"),
|
38 |
+
gr.inputs.Number(default=1.0, label="gender"),
|
39 |
gr.inputs.Number(default=1.0, label="age"),
|
40 |
gr.inputs.Number(default=1.0, label="sibsp"),
|
41 |
gr.inputs.Number(default=1.0, label="parch"),
|
42 |
+
gr.inputs.Number(default=1.0, label="embarked"),
|
43 |
gr.inputs.Number(default=1.0, label="fare_per_customer"),
|
44 |
+
gr.inputs.Number(default=1.0, label="cabin"),
|
45 |
],
|
46 |
outputs=gr.Textbox()
|
47 |
)
|