Update app.py
Browse files
app.py
CHANGED
|
@@ -49,7 +49,6 @@ st.markdown("""
|
|
| 49 |
|
| 50 |
st.markdown("<h1 class='title'>Life Expectancy Prediction</h1>", unsafe_allow_html=True)
|
| 51 |
|
| 52 |
-
st.markdown("<h3 class='section-title'>General Information</h3>", unsafe_allow_html=True)
|
| 53 |
col1, col2 = st.columns(2)
|
| 54 |
|
| 55 |
with col1:
|
|
@@ -95,77 +94,3 @@ if st.button("Predict Life Expectancy"):
|
|
| 95 |
)
|
| 96 |
|
| 97 |
|
| 98 |
-
|
| 99 |
-
# import streamlit as st
|
| 100 |
-
# import numpy as np
|
| 101 |
-
# import pickle
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
# model = pickle.load(open("life_expectancy_model.pkl", "rb"))
|
| 105 |
-
|
| 106 |
-
# st.markdown("""
|
| 107 |
-
# <style>
|
| 108 |
-
# .title-container {
|
| 109 |
-
# text-align: center;
|
| 110 |
-
# font-size: 36px;
|
| 111 |
-
# font-weight: bold;
|
| 112 |
-
# background: -webkit-linear-gradient(45deg, #ff7e5f, #feb47b);
|
| 113 |
-
# -webkit-background-clip: text;
|
| 114 |
-
# -webkit-text-fill-color: transparent;
|
| 115 |
-
# }
|
| 116 |
-
# .result-box {
|
| 117 |
-
# background-color: #4CAF50;
|
| 118 |
-
# padding: 15px;
|
| 119 |
-
# border-radius: 10px;
|
| 120 |
-
# color: white;
|
| 121 |
-
# text-align: center;
|
| 122 |
-
# font-size: 22px;
|
| 123 |
-
# font-weight: bold;
|
| 124 |
-
# margin-top: 20px;
|
| 125 |
-
# }
|
| 126 |
-
# .sidebar-title {
|
| 127 |
-
# font-size: 22px;
|
| 128 |
-
# font-weight: bold;
|
| 129 |
-
# color: #ff7e5f;
|
| 130 |
-
# text-align: center;
|
| 131 |
-
# }
|
| 132 |
-
# </style>
|
| 133 |
-
# """, unsafe_allow_html=True)
|
| 134 |
-
|
| 135 |
-
# st.markdown("<h1 class='title-container'>Life Expectancy Prediction</h1>", unsafe_allow_html=True)
|
| 136 |
-
# st.markdown("### Enter the required details in the sidebar to get the predicted life expectancy.")
|
| 137 |
-
|
| 138 |
-
# st.sidebar.markdown("<h2 class='sidebar-title'>Input Features</h2>", unsafe_allow_html=True)
|
| 139 |
-
|
| 140 |
-
# year = st.sidebar.slider("Year", 2000, 2015, 2008)
|
| 141 |
-
# status = st.sidebar.radio("Status", ["Developing", "Developed"], horizontal=True)
|
| 142 |
-
# status = 1 if status == "Developed" else 0
|
| 143 |
-
# adult_mortality = st.sidebar.slider("Adult Mortality Rate", 1, 723, 144)
|
| 144 |
-
# infant_deaths = st.sidebar.slider("Infant Deaths", 0, 1800, 3)
|
| 145 |
-
# alcohol = st.sidebar.slider("Alcohol Consumption", 0.01, 17.87, 4.55)
|
| 146 |
-
# percentage_expenditure = st.sidebar.slider("Percentage Expenditure", 0.0, 19479.91, 738.25)
|
| 147 |
-
# hepatitis_b = st.sidebar.slider("Hepatitis B Immunization (%)", 1, 99, 83)
|
| 148 |
-
# measles = st.sidebar.slider("Measles Cases", 0, 212183, 2419)
|
| 149 |
-
# bmi = st.sidebar.slider("BMI", 1.0, 87.3, 38.3)
|
| 150 |
-
# under_five_deaths = st.sidebar.slider("Under-Five Deaths", 0, 2500, 4)
|
| 151 |
-
# polio = st.sidebar.slider("Polio Immunization (%)", 3, 99, 82)
|
| 152 |
-
# total_expenditure = st.sidebar.slider("Total Healthcare Expenditure (%)", 0.37, 17.6, 5.92)
|
| 153 |
-
# diphtheria = st.sidebar.slider("Diphtheria Immunization (%)", 2, 99, 82)
|
| 154 |
-
# hiv_aids = st.sidebar.slider("HIV/AIDS Prevalence Rate", 0.1, 50.6, 1.74)
|
| 155 |
-
# gdp = st.sidebar.slider("GDP per Capita", 1.68, 119172.7, 6611.52)
|
| 156 |
-
# population = st.sidebar.slider("Population", 34, 1293859000, 10230850)
|
| 157 |
-
# thinness_1_19 = st.sidebar.slider("Thinness 1-19 years (%)", 0.1, 27.7, 4.83)
|
| 158 |
-
# thinness_5_9 = st.sidebar.slider("Thinness 5-9 years (%)", 0.1, 28.6, 4.86)
|
| 159 |
-
# income_composition = st.sidebar.slider("Income Composition of Resources", 0.0, 0.948, 0.63)
|
| 160 |
-
# schooling = st.sidebar.slider("Schooling (Years)", 0.0, 20.7, 11.99)
|
| 161 |
-
|
| 162 |
-
# if st.button("Predict Life Expectancy"):
|
| 163 |
-
# features = np.array([[year, status, adult_mortality, infant_deaths, alcohol, percentage_expenditure,
|
| 164 |
-
# hepatitis_b, measles, bmi, under_five_deaths, polio, total_expenditure,
|
| 165 |
-
# diphtheria, hiv_aids, gdp, population, thinness_1_19, thinness_5_9,
|
| 166 |
-
# income_composition, schooling]])
|
| 167 |
-
|
| 168 |
-
# prediction = model.predict(features)[0]
|
| 169 |
-
|
| 170 |
-
# st.markdown(f'<div class="result-box">Predicted Life Expectancy: <b>{prediction:.2f} years</b></div>',
|
| 171 |
-
# unsafe_allow_html=True)
|
|
|
|
| 49 |
|
| 50 |
st.markdown("<h1 class='title'>Life Expectancy Prediction</h1>", unsafe_allow_html=True)
|
| 51 |
|
|
|
|
| 52 |
col1, col2 = st.columns(2)
|
| 53 |
|
| 54 |
with col1:
|
|
|
|
| 94 |
)
|
| 95 |
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|