Commit
·
97708fd
1
Parent(s):
994c3d0
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import numpy as np
|
| 3 |
+
import pickle
|
| 4 |
+
import streamlit.components.v1 as components
|
| 5 |
+
|
| 6 |
+
# Load the pickled model
|
| 7 |
+
def load_model():
|
| 8 |
+
return pickle.load(open('china_gdp_estimate_rr.pkl', 'rb'))
|
| 9 |
+
|
| 10 |
+
# Function for model prediction
|
| 11 |
+
def model_prediction(model, features):
|
| 12 |
+
predicted = str(model.predict(features))
|
| 13 |
+
return predicted
|
| 14 |
+
|
| 15 |
+
def app_design():
|
| 16 |
+
# Add input fields for High, Open, and Low values
|
| 17 |
+
image = '8.png'
|
| 18 |
+
st.image(image, use_column_width=True)
|
| 19 |
+
|
| 20 |
+
st.subheader("Enter the following values:")
|
| 21 |
+
|
| 22 |
+
Y_2000 = st.number_input("Y_2000")
|
| 23 |
+
Y_2001 = st.number_input("Y_2001")
|
| 24 |
+
Y_2002 = st.number_input("Y_2002")
|
| 25 |
+
Y_2003 = st.number_input("Y_2003")
|
| 26 |
+
Y_2004 = st.number_input("Y_2004")
|
| 27 |
+
Y_2005 = st.number_input("Y_2005")
|
| 28 |
+
Y_2006 = st.number_input("Y_2006")
|
| 29 |
+
Y_2007 = st.number_input("Y_2007")
|
| 30 |
+
Y_2008 = st.number_input("Y_2008")
|
| 31 |
+
Y_2009 = st.number_input("Y_2009")
|
| 32 |
+
Y_2010 = st.number_input("Y_2010")
|
| 33 |
+
Y_2011 = st.number_input("Y_2011")
|
| 34 |
+
Y_2012 = st.number_input("Y_2012")
|
| 35 |
+
Y_2013 = st.number_input("Y_2013")
|
| 36 |
+
Y_2014 = st.number_input("Y_2014")
|
| 37 |
+
Y_2015 = st.number_input("Y_2015")
|
| 38 |
+
Y_2016 = st.number_input("Y_2016")
|
| 39 |
+
Y_2017 = st.number_input("Y_2017")
|
| 40 |
+
Y_2018 = st.number_input("Y_2018")
|
| 41 |
+
Y_2019 = st.number_input("Y_2019")
|
| 42 |
+
Y_2020 = st.number_input("Y_2020")
|
| 43 |
+
|
| 44 |
+
# Create a feature list from the user inputs
|
| 45 |
+
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]]
|
| 46 |
+
|
| 47 |
+
# Load the model
|
| 48 |
+
model = load_model()
|
| 49 |
+
|
| 50 |
+
# Make a prediction when the user clicks the "Predict" button
|
| 51 |
+
if st.button('Predict GDP'):
|
| 52 |
+
predicted_value = model_prediction(model, features)
|
| 53 |
+
st.success(f"The Price is: {predicted_value}")
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def about_hidevs():
|
| 57 |
+
|
| 58 |
+
components.html("""
|
| 59 |
+
<div>
|
| 60 |
+
<h4>🚀 Unlock Your Dream Job with HiDevs Community!</h4>
|
| 61 |
+
<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>
|
| 62 |
+
<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>
|
| 63 |
+
<p class="subtitle">🆓 Best of all, everything we offer is <b>completely free</b>! We are dedicated to helping society.</p>
|
| 64 |
+
<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>
|
| 65 |
+
<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>
|
| 66 |
+
<p class="subtitle">💡 Join us now, and turbocharge your career!</p>
|
| 67 |
+
<p class="subtitle"><a class="link" href="https://hidevscommunity.wixsite.com/hidevs" target="__blank">Website</a>
|
| 68 |
+
<a class="link" href="https://www.youtube.com/@HidevsCommunity1307/" target="__blank">YouTube</a>
|
| 69 |
+
<a class="link" href="https://www.instagram.com/hidevs_community/" target="__blank">Instagram</a>
|
| 70 |
+
<a class="link" href="https://medium.com/@hidevscommunity" target="__blank">Medium</a>
|
| 71 |
+
<a class="link" href="https://www.linkedin.com/company/hidevs-community/" target="__blank">LinkedIn</a>
|
| 72 |
+
<a class="link" href="https://github.com/hidevscommunity" target="__blank">GitHub</a></p>
|
| 73 |
+
</div>
|
| 74 |
+
""",
|
| 75 |
+
height=600)
|
| 76 |
+
|
| 77 |
+
def main():
|
| 78 |
+
|
| 79 |
+
# Set the app title and add your website name and logo
|
| 80 |
+
st.set_page_config(
|
| 81 |
+
page_title="China GDP Estimation",
|
| 82 |
+
page_icon=":chart_with_upwards_trend:",
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
st.title("Welcome to our China GDP Estimation App!")
|
| 86 |
+
|
| 87 |
+
app_design()
|
| 88 |
+
st.header("About HiDevs Community")
|
| 89 |
+
about_hidevs()
|
| 90 |
+
|
| 91 |
+
if __name__ == '__main__':
|
| 92 |
+
main()
|