hidevscommunity commited on
Commit
602ab54
·
verified ·
1 Parent(s): 0049437

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +100 -0
app.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('Student_Marks_LinearRegresssionnew.pkl', 'rb')) #change
9
+
10
+ # Function for model prediction
11
+ def model_prediction(model, features):
12
+ predicted = str(model.predict(features)[0])
13
+ return predicted
14
+
15
+ def app_design():
16
+ # Add input fields for High, Open, and Low values
17
+ image = '38.png' #change
18
+ st.image(image, use_column_width=True)
19
+
20
+ st.subheader("Enter the following values:") #change
21
+
22
+ school= st.number_input("school")
23
+ sex= st.number_input("sex")
24
+ age= st.number_input("age")
25
+ famsize= st.number_input("famsize")
26
+ Pstatus= st.number_input("Pstatus")
27
+ Medu= st.number_input("Medu")
28
+ Fedu= st.number_input("Fedu")
29
+ Mjob= st.number_input("Mjob")
30
+ Fjob= st.number_input("Fjob")
31
+ reason = st.number_input("reason")
32
+ guardian= st.number_input("guardian")
33
+ traveltime= st.number_input("traveltime")
34
+ studytime= st.number_input("studytime")
35
+ failures= st.number_input("failures")
36
+ schoolsup= st.number_input("schoolsup")
37
+ paid= st.number_input("paid")
38
+ activities= st.number_input("activities")
39
+ nursery= st.number_input("nursery")
40
+ internet= st.number_input("internet")
41
+ freetime= st.number_input("freetime")
42
+ goout= st.number_input("goout")
43
+ Dalc= st.number_input("Dalc")
44
+ Walc= st.number_input("Walc")
45
+ health= st.number_input("health")
46
+ absences= st.number_input("absences")
47
+ G1= st.number_input("G1")
48
+ G2= st.number_input("G2")
49
+
50
+
51
+ # Create a feature list from the user inputs
52
+ features = [[school,sex,age,famsize,Pstatus,Medu,Fedu,Mjob,Fjob,reason,guardian,traveltime,studytime,failures,schoolsup,famsup,paid,activities,nursery,higher,internet,famrel,freetime,goout,Dalc,Walc,health,absences,G1,G2]]
53
+
54
+ # Load the model
55
+ model = load_model()
56
+
57
+ # Make a prediction when the user clicks the "Predict" button
58
+ if st.button('Predict Grade'):
59
+ predicted_value = model_prediction(model, features)
60
+
61
+ st.success(f"Student Grade is: {predicted_value}")
62
+
63
+
64
+ def about_hidevs():
65
+
66
+ components.html("""
67
+ <div>
68
+ <h4>🚀 Unlock Your Dream Job with HiDevs Community!</h4>
69
+ <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>
70
+ <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>
71
+ <p class="subtitle">🆓 Best of all, everything we offer is <b>completely free</b>! We are dedicated to helping society.</p>
72
+ <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>
73
+ <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>
74
+ <p class="subtitle">💡 Join us now, and turbocharge your career!</p>
75
+ <p class="subtitle"><a class="link" href="https://hidevscommunity.wixsite.com/hidevs" target="__blank">Website</a>
76
+ <a class="link" href="https://www.youtube.com/@HidevsCommunity1307/" target="__blank">YouTube</a>
77
+ <a class="link" href="https://www.instagram.com/hidevs_community/" target="__blank">Instagram</a>
78
+ <a class="link" href="https://medium.com/@hidevscommunity" target="__blank">Medium</a>
79
+ <a class="link" href="https://www.linkedin.com/company/hidevs-community/" target="__blank">LinkedIn</a>
80
+ <a class="link" href="https://github.com/hidevscommunity" target="__blank">GitHub</a></p>
81
+ </div>
82
+ """,
83
+ height=600)
84
+
85
+ def main():
86
+
87
+ # Set the app title and add your website name and logo
88
+ st.set_page_config(
89
+ page_title="Student Gade Prediction",
90
+ page_icon=":chart_with_upwards_trend:",
91
+ )
92
+
93
+ st.title("Welcome to our Student Grade Prediction App!")
94
+
95
+ app_design()
96
+ st.header("About HiDevs Community")
97
+ about_hidevs()
98
+
99
+ if __name__ == '__main__':
100
+ main()