import streamlit as st import api print(api.data) st.title("Health Care Prediction App") st.markdown("### Predict whether a patient has a certain disease or not") st.sidebar.title("Predictive Models") st.sidebar.markdown("Select the model you want to use") model_type = st.sidebar.selectbox("Model", ("Diabetes", "Breast Cancer", "Heart Disease", "Kidney Disease", "Liver Disease")) st.sidebar.title("How to use") st.sidebar.markdown( "Select the model you want to use. Then, enter the values in the fields and click on the 'Predict' button to check the prediction." ) st.sidebar.title("About") st.sidebar.info( "This web app is to predict whether a patient has a certain disease or not. Built with Streamlit by [Pix2Pred Team]()" ) with st.expander("Prection"): if model_type == "Diabetes": st.markdown("### Diabetes") st.markdown("#### Please enter the details of the patient") st.markdown("#### Features:") st.markdown("* Pregnancies: Number of times pregnant") st.markdown("* Glucose: Plasma glucose concentration a 2 hours in an oral glucose tolerance test") st.markdown("* BloodPressure: Diastolic blood pressure (mm Hg)") st.markdown("* SkinThickness: Triceps skin fold thickness (mm)") st.markdown("* Insulin: 2-Hour serum insulin (mu U/ml)") st.markdown("* BMI: Body mass index (weight in kg/(height in m)^2)") st.markdown("* DiabetesPedigreeFunction: Diabetes pedigree function") st.markdown("* Age: Age (years)") st.markdown("* Outcome: Class variable (0 or 1) 268 of 768 are 1, the others are 0") st.markdown("#### Enter the values in the fields below") pregnancies = st.number_input("Pregnancies", min_value=0, max_value=20, value=0) glucose = st.number_input("Glucose", min_value=0, max_value=200, value=0) blood_pressure = st.number_input("Blood Pressure", min_value=0, max_value=200, value=0) skin_thickness = st.number_input("Skin Thickness", min_value=0, max_value=100, value=0) insulin = st.number_input("Insulin", min_value=0, max_value=800, value=0) bmi = st.number_input("BMI", min_value=0, max_value=100, value=0) diabetes_pedigree_function = st.number_input("Diabetes Pedigree Function", min_value=0.0, max_value=2.0, value=0.0) age = st.number_input("Age", min_value=0, max_value=120, value=0) if st.button("Predict"): # print the prediction st.write("The patient has diabetes:", predict(model_type, [pregnancies, glucose, blood_pressure, skin_thickness, insulin, bmi, diabetes_pedigree_function, age])) st.subheader("About") st.write("This is a simple web app to predict the price of the house based on the square feet. I used only 10 data points to train the model. So, the predictions may not be accurate. The model used is Linear Regression. Purpose of this project is to learn how to deploy a machine learning model.") st.write("Built by [Pix2Pred Team]() using Streamlit.")