Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,9 +59,9 @@ def predict_survival(sex, age, fare):
|
|
59 |
pred = clf.predict_proba(df)[0]
|
60 |
return {'Perishes': float(pred[0]), 'Survives': float(pred[1])}
|
61 |
|
62 |
-
sex = gr.
|
63 |
-
age = gr.
|
64 |
-
fare = gr.
|
65 |
|
66 |
gr.Interface(predict_survival, [sex, age, fare], "label", live=True, thumbnail="https://raw.githubusercontent.com/gradio-app/hub-titanic/master/thumbnail.png", analytics_enabled=False,
|
67 |
theme="soft", title="Surviving the Titanic", description="What is the probability that a passenger on the Titanic would survive the famous wreck? It depends on their demographics as this live interface demonstrates.").launch();
|
|
|
59 |
pred = clf.predict_proba(df)[0]
|
60 |
return {'Perishes': float(pred[0]), 'Survives': float(pred[1])}
|
61 |
|
62 |
+
sex = gr.Radio(['female', 'male'], label="Sex", value="male")
|
63 |
+
age = gr.Slider(minimum=0, maximum=120, default=22, label="Age")
|
64 |
+
fare = gr.Slider(minimum=0, maximum=200, default=100, label="Fare (british pounds)")
|
65 |
|
66 |
gr.Interface(predict_survival, [sex, age, fare], "label", live=True, thumbnail="https://raw.githubusercontent.com/gradio-app/hub-titanic/master/thumbnail.png", analytics_enabled=False,
|
67 |
theme="soft", title="Surviving the Titanic", description="What is the probability that a passenger on the Titanic would survive the famous wreck? It depends on their demographics as this live interface demonstrates.").launch();
|