hidevscommunity's picture
Update app.py
871f3f1 verified
import streamlit as st
import numpy as np
import pickle
import streamlit.components.v1 as components
# Load the pickled model
def load_model():
return pickle.load(open('china_gdp_estimate_rr.pkl', 'rb'))
# Function for model prediction
def model_prediction(model, features):
predicted = str(model.predict(features))
return predicted
def app_design():
# Add input fields for High, Open, and Low values
image = '8.png'
st.image(image, use_column_width=True)
st.subheader("Enter the following values:")
Y_2000 = st.number_input("Year_2000",max_value=9999999999999999999.00)
Y_2001 = st.number_input("Year_2001",max_value=9999999999999999999.00)
Y_2002 = st.number_input("Year_2002",max_value=9999999999999999999.00)
Y_2003 = st.number_input("Year_2003",max_value=9999999999999999999.00)
Y_2004 = st.number_input("Year_2004",max_value=9999999999999999999.00)
Y_2005 = st.number_input("Year_2005",max_value=9999999999999999999.00)
Y_2006 = st.number_input("Year_2006",max_value=9999999999999999999.00)
Y_2007 = st.number_input("Year_2007",max_value=9999999999999999999.00)
Y_2008 = st.number_input("Year_2008",max_value=9999999999999999999.00)
Y_2009 = st.number_input("Year_2009",max_value=9999999999999999999.00)
Y_2010 = st.number_input("Year_2010",max_value=9999999999999999999.00)
Y_2011 = st.number_input("Year_2011",max_value=9999999999999999999.00)
Y_2012 = st.number_input("Year_2012",max_value=9999999999999999999.00)
Y_2013 = st.number_input("Year_2013",max_value=9999999999999999999.00)
Y_2014 = st.number_input("Year_2014",max_value=9999999999999999999.00)
Y_2015 = st.number_input("Year_2015",max_value=9999999999999999999.00)
Y_2016 = st.number_input("Year_2016",max_value=9999999999999999999.00)
Y_2017 = st.number_input("Year_2017",max_value=9999999999999999999.00)
Y_2018 = st.number_input("Year_2018",max_value=9999999999999999999.00)
Y_2019 = st.number_input("Year_2019",max_value=9999999999999999999.00)
Y_2020 = st.number_input("Year_2020",max_value=9999999999999999999.00)
# Create a feature list from the user inputs
features = [[Y_2000, Y_2001, Y_2002, Y_2003, Y_2004, Y_2005, Y_2006, Y_2007, Y_2008, Y_2009,Y_2010,Y_2011,Y_2012,Y_2013,Y_2014,Y_2015,Y_2016,Y_2017,Y_2018,Y_2019,Y_2020]]
# Load the model
model = load_model()
# Make a prediction when the user clicks the "Predict" button
if st.button('Predict GDP'):
predicted_value = model_prediction(model, features)
st.success(f"The calculated GDP is: {predicted_value}")
def about_hidevs():
components.html("""
<div>
<h4>🚀 Unlock Your Dream Job with HiDevs Community!</h4>
<p class="subtitle">🔍 Seeking the perfect job? HiDevs Community is your gateway to career success in the tech industry. Explore free expert courses, job-seeking support, and career transformation tips.</p>
<p class="subtitle">💼 We offer an upskill program in <b>Gen AI, Data Science, Machine Learning</b>, and assist startups in adopting <b>Gen AI</b> at minimal development costs.</p>
<p class="subtitle">🆓 Best of all, everything we offer is <b>completely free</b>! We are dedicated to helping society.</p>
<p class="subtitle">Book free of cost 1:1 mentorship on any topic of your choice — <a class="link" href="https://topmate.io/deepakchawla1307">topmate</a></p>
<p class="subtitle">✨ We dedicate over 30 minutes to each applicant’s resume, LinkedIn profile, mock interview, and upskill program. If you’d like our guidance, check out our services <a class="link" href="https://hidevscommunity.wixsite.com/hidevs">here</a></p>
<p class="subtitle">💡 Join us now, and turbocharge your career!</p>
<p class="subtitle"><a class="link" href="https://hidevscommunity.wixsite.com/hidevs" target="__blank">Website</a>
<a class="link" href="https://www.youtube.com/@HidevsCommunity1307/" target="__blank">YouTube</a>
<a class="link" href="https://www.instagram.com/hidevs_community/" target="__blank">Instagram</a>
<a class="link" href="https://medium.com/@hidevscommunity" target="__blank">Medium</a>
<a class="link" href="https://www.linkedin.com/company/hidevs-community/" target="__blank">LinkedIn</a>
<a class="link" href="https://github.com/hidevscommunity" target="__blank">GitHub</a></p>
</div>
""",
height=600)
def main():
# Set the app title and add your website name and logo
st.set_page_config(
page_title="China GDP Estimation",
page_icon=":chart_with_upwards_trend:",
)
st.title("Welcome to our China GDP Estimation App!")
app_design()
st.header("About HiDevs Community")
about_hidevs()
if __name__ == '__main__':
main()