acko_app / app.py
GS123's picture
Upload 5 files
9f1a491 verified
import numpy as np
import streamlit as st
import joblib
logo_url = "logo.png"
banner_path = "banner.jpg"
col1, col2= st.columns([1, 3])
with col1:
st.image(logo_url, width = 100)
with col2:
st.write("# Acko Insurance App")
st.image(banner_path)
age = st.number_input("Enter your age", step = 1)
height_ft = st.number_input("Enter feet part of your height", step = 1,value = 5)
height_inch = st.number_input("Enter inch part of your height", step = 1, value = 5)
weight_kg = st.number_input("Enter your weight in KG")
height_meter = height_ft *0.3048 + height_inch*0.0254
bmi = round(weight_kg/height_meter**2,2)
smoker = st.selectbox(
"Enter your smoking status?",
("yes", "no"))
children = st.selectbox(
"Enter Number of children",
(0,1,2,3,4))
test_data = np.array([[age, bmi, smoker, children]])
st.write(test_data)
# load model
model = joblib.load("insurance_joblib")
# predict button
if st.button("Predict"):
y_pred = model.predict(test_data)
amount = np.round(y_pred**2,2)[0]
st.write(f"## Your Insurance Premium amount is: ${amount}")