-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.py
60 lines (34 loc) · 1.17 KB
/
app.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
@author: Priyang Bhatt
"""
import streamlit as st
import joblib
import numpy as np
def main():
html_temp = """
<div style="background-color:lightblue;padding:16px">
<h2 style="color:black";text-align:center> Health Insurance Cost Prediction Using ML</h2>
</div>
"""
st.markdown(html_temp,unsafe_allow_html=True)
model = joblib.load('model_joblib_gr')
p1 = st.slider('Enter Your Age',18,100)
s1 = st.selectbox('Sex',('Male','Female'))
if s1=='Male':
p2=1
else:
p2=0
p3 = st.number_input("Enter Your BMI Value")
p4 = st.slider("Enter Number of Children",0,4)
s2 = st.selectbox("Smoker",("Yes","No"))
if s2=='Yes':
p5=1
else:
p5=0
p6 = st.slider("Enter Your Region",1,4)
if st.button('Predict'):
pred= model.predict([[p1,p2,p3,p4,p5,p6]])
st.balloons()
st.success('Your Insurance Cost is {}'.format(round(pred[0],2)))
if __name__ == '__main__':
main()