CoolFace
Apppublic

norsu/Life_expectancy

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
app.py26 linesDownload Raw Back to root
1import streamlit as st2import pickle as pk3from sklearn.linear_model import LinearRegression4import numpy as np5import pandas as pd6 7model = pk.load(open(r"abc.pickle", "rb"))8 9st.title("Life Expectancy Predictor")10 11Birth_Rate = st.text_input("Birth Rate")12Fertility_Rate = st.text_input("Fertility Rate")13Infant_mortality = st.text_input("Infant mortality per 1000 births")14Maternal_mortality_ratio = st.text_input("Maternal mortality per 100000 births")15Physicians_per_thousand = st.text_input("Physicians per 1000")16 17 18k = st.button("Predict")19 20 21if k:22    x = pd.DataFrame([[Birth_Rate,Fertility_Rate,Infant_mortality,Maternal_mortality_ratio,Physicians_per_thousand]])23    x.columns = ["Birth Rate","Fertility Rate","Infant mortality","Maternal mortality ratio","Physicians per thousand"]24    prediction = model.predict(x)25    st.markdown(np.round(prediction[0],2))26