-
Notifications
You must be signed in to change notification settings - Fork 0
/
streamlit_app.py
50 lines (35 loc) · 1.3 KB
/
streamlit_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
# importing Important Liberaries
import pickle
import streamlit as st
import numpy as np
# Load model
model_diabetes = pickle.load(open('model_diabetes_logistic.sav', 'rb'))
# Web Title
st.title('Diabetes Prediction')
# Split Columns
col1, col2 = st.columns(2)
with col1 :
Pregnancies = st.number_input('Enter the Pregnancies value')
with col2 :
Glucose = st.number_input('Enter the Glucose value')
with col1 :
BloodPressure = st.number_input('Enter the Blood Pressure value')
with col2 :
SkinThickness = st.number_input('Enter the Skin Thickness value')
with col1 :
Insulin = st.number_input('Enter the Insulin value')
with col2 :
BMI = st.number_input('Enter the BMI value')
with col1 :
DiabetesPedigreeFunction = st.number_input('Enter the Diabetes Pedigree Function value')
with col2 :
Age = st.number_input('Enter the Age value')
# Prediction
diabetes_diagnosis = ''
if st.button('Diabetes Prediction Test'):
diabetes_prediction = model_diabetes.predict([[Pregnancies,Glucose,BloodPressure,SkinThickness,Insulin,BMI,DiabetesPedigreeFunction,Age]])
if(diabetes_prediction[0]==1):
diabetes_diagnosis = 'The patient has diabetes'
else :
diabetes_diagnosis = 'The patient does not have diabetes'
st.success(diabetes_diagnosis)