Campfireman commited on
Commit
ed6ea16
1 Parent(s): 398b73b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -27,21 +27,21 @@ def tb_titanic(pclass,sex,age,sibsp,parch,embarked,fare_per_customer,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, 8))
30
- return ("This guy will"+("survive. " if res[0]==1 else "die. "))
31
 
32
  demo = gr.Interface(
33
  fn=tb_titanic,
34
  title="Titanic Predictive Analytics",
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
  )
 
27
  # 'res' is a list of predictions returned as the label.
28
  #global res
29
  res = model.predict(np.asarray(input_list).reshape(1, 8))
30
+ return ("This guy will"+(" survive. " if res[0]==1 else " die. "))
31
 
32
  demo = gr.Interface(
33
  fn=tb_titanic,
34
  title="Titanic Predictive Analytics",
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, 0 for male and 1 for female"),
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, 1 for C, 2 for S, 3 for Q, and 0 for unknown"),
43
  gr.inputs.Number(default=1.0, label="fare_per_customer"),
44
+ gr.inputs.Number(default=1.0, label="cabin, 1 for the known and 0 for the unknown"),
45
  ],
46
  outputs=gr.Textbox()
47
  )