File size: 819 Bytes
02d1a41 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
#!/usr/bin/env python
# coding: utf-8
# In[3]:
# !pip install gradio
import gradio as gr
from joblib import load
model = load("model.joblib")
def prediction(pclass,sex,age,parch,fare):
inp = [[pclass,sex,age,parch,fare]]
pre = model.predict(inp)[0]
return "Alive" if pre==1 else "Dead"
iface = gr.Interface(
fn = prediction,
inputs = [gr.Number(label="Passenger Class"),
gr.Number(label="Gender (0:Male,1:Female)"),
gr.Number(label="Age"),
gr.Number(label="No. of People"),
gr.Number(label="Fare")],
outputs = "text",
title = "Survival Possibility",
description = "This is a calculator which tells you the Alive/Dead possibility.")
iface.launch()
# In[ ]:
|