hidevscommunity commited on
Commit
e9289a6
·
verified ·
1 Parent(s): 4e492c5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +91 -0
app.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Load the pickled model
8
+ def load_model():
9
+ return pickle.load(open('Stock_Prediction_li.pkl', 'rb'))
10
+
11
+ # Function for model prediction
12
+ def model_prediction(model, features):
13
+ predicted = str(model.predict(features)[0])
14
+ return predicted
15
+
16
+ def transform(text):
17
+ text = le.fit_transform(text)
18
+ return text[0]
19
+
20
+ def app_design():
21
+ # Add input fields for High, Open, and Low values
22
+ image = '35.png'
23
+ st.image(image, use_column_width=True)
24
+
25
+ st.subheader("Enter the following values:")
26
+
27
+ #Encoding categorical data values
28
+
29
+ date = st.text_input("Date (DD/MM/YYYY)")
30
+ date = transform([date])
31
+
32
+ openn = st.number_input("Openn")
33
+
34
+ high = st.number_input("High")
35
+
36
+ low = st.number_input("Low")
37
+
38
+ volume = st.number_input("Volume")
39
+
40
+ Name = st.text_input("Name")
41
+ Name = transform([Name])
42
+
43
+ # Create a feature list from the user inputs
44
+ features = [[date,openn,high,low,volume,Name]]
45
+
46
+ # Load the model
47
+ model = load_model()
48
+
49
+ # Make a prediction when the user clicks the "Predict" button
50
+ if st.button('Predict Price'):
51
+ predicted_value = model_prediction(model, features)
52
+ st.success(f"The close is: {predicted_value}")
53
+
54
+
55
+ def about_hidevs():
56
+
57
+ components.html("""
58
+ <div>
59
+ <h4>🚀 Unlock Your Dream Job with HiDevs Community!</h4>
60
+ <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>
61
+ <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>
62
+ <p class="subtitle">🆓 Best of all, everything we offer is <b>completely free</b>! We are dedicated to helping society.</p>
63
+ <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>
64
+ <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>
65
+ <p class="subtitle">💡 Join us now, and turbocharge your career!</p>
66
+ <p class="subtitle"><a class="link" href="https://hidevscommunity.wixsite.com/hidevs" target="__blank">Website</a>
67
+ <a class="link" href="https://www.youtube.com/@HidevsCommunity1307/" target="__blank">YouTube</a>
68
+ <a class="link" href="https://www.instagram.com/hidevs_community/" target="__blank">Instagram</a>
69
+ <a class="link" href="https://medium.com/@hidevscommunity" target="__blank">Medium</a>
70
+ <a class="link" href="https://www.linkedin.com/company/hidevs-community/" target="__blank">LinkedIn</a>
71
+ <a class="link" href="https://github.com/hidevscommunity" target="__blank">GitHub</a></p>
72
+ </div>
73
+ """,
74
+ height=600)
75
+
76
+ def main():
77
+
78
+ # Set the app title and add your website name and logo
79
+ st.set_page_config(
80
+ page_title="Stock Price Prediction",
81
+ page_icon=":chart_with_upwards_trend:",
82
+ )
83
+
84
+ st.title("Welcome to our Stock Price Prediction App!")
85
+
86
+ app_design()
87
+ st.header("About HiDevs Community")
88
+ about_hidevs()
89
+
90
+ if __name__ == '__main__':
91
+ main()