hidevscommunity commited on
Commit
a4d82e7
·
verified ·
1 Parent(s): 3d105cb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +103 -0
app.py ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import numpy as np
3
+ import pickle
4
+ import streamlit.components.v1 as components
5
+ from sklearn.preprocessing import LabelEncoder
6
+ le = LabelEncoder()
7
+
8
+
9
+
10
+ # Load the pickled model
11
+ def load_model():
12
+ return pickle.load(open('Number_of_orders_Prediction_LinearRegression.pkl', 'rb')) #change
13
+
14
+ # Function for model prediction
15
+ def model_prediction(model, features):
16
+ predicted = str(model.predict(features)[0])
17
+ return predicted
18
+
19
+
20
+
21
+ def app_design():
22
+ # Add input fields for High, Open, and Low values
23
+ image = '24.jpg' #change
24
+ st.image(image, use_column_width=True)
25
+
26
+ st.subheader("Enter the following values:") #change
27
+
28
+ Store_id = st.number_input("Day of week")
29
+ Store_Type = st.text_input("Week of year")
30
+ Store_Type = le.transform([Store_Type])
31
+ Location_Type= st.text_input("Year")
32
+ Location_Type = le.transform([Location_Type])
33
+ Region_Code = st.text_input("Period Of Day")
34
+ Region_Code = le.transform([Region_Code])
35
+ Date = st.number_input("Forecast Wind Production")
36
+ Date = le.transform([Date])
37
+ Holiday = st.number_input("System Load EA")
38
+ Discount = st.text_input("SMPEA")
39
+ Discount = le.transform([Discount])
40
+ Order2 = st.number_input("ORK Winds peed")
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ # Create a feature list from the user inputs
55
+ features = [[Store_id,Store_Type,Location_Type,Region_Code,Date,Holiday,Discount,Order2]]
56
+
57
+ # Load the model
58
+ model = load_model()
59
+
60
+ # Make a prediction when the user clicks the "Predict" button
61
+ if st.button('Predict Orders'):
62
+ predicted_value = model_prediction(model, features)
63
+
64
+ st.success(f"The orders are: {predicted_value}")
65
+
66
+
67
+ def about_hidevs():
68
+
69
+ components.html("""
70
+ <div>
71
+ <h4>🚀 Unlock Your Dream Job with HiDevs Community!</h4>
72
+ <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>
73
+ <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>
74
+ <p class="subtitle">🆓 Best of all, everything we offer is <b>completely free</b>! We are dedicated to helping society.</p>
75
+ <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>
76
+ <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>
77
+ <p class="subtitle">💡 Join us now, and turbocharge your career!</p>
78
+ <p class="subtitle"><a class="link" href="https://hidevscommunity.wixsite.com/hidevs" target="__blank">Website</a>
79
+ <a class="link" href="https://www.youtube.com/@HidevsCommunity1307/" target="__blank">YouTube</a>
80
+ <a class="link" href="https://www.instagram.com/hidevs_community/" target="__blank">Instagram</a>
81
+ <a class="link" href="https://medium.com/@hidevscommunity" target="__blank">Medium</a>
82
+ <a class="link" href="https://www.linkedin.com/company/hidevs-community/" target="__blank">LinkedIn</a>
83
+ <a class="link" href="https://github.com/hidevscommunity" target="__blank">GitHub</a></p>
84
+ </div>
85
+ """,
86
+ height=600)
87
+
88
+ def main():
89
+
90
+ # Set the app title and add your website name and logo
91
+ st.set_page_config(
92
+ page_title="Number of Orders Prediction",
93
+ page_icon=":chart_with_upwards_trend:",
94
+ )
95
+
96
+ st.title("Welcome to our Number of Orders Prediction App!")
97
+
98
+ app_design()
99
+ st.header("About HiDevs Community")
100
+ about_hidevs()
101
+
102
+ if __name__ == '__main__':
103
+ main()