File size: 5,405 Bytes
602ab54
 
 
 
76cfc21
 
602ab54
 
7098018
602ab54
 
 
 
 
a95db11
 
1436661
76cfc21
 
602ab54
 
76cfc21
602ab54
 
 
76cfc21
c56534a
1436661
7cecc4b
1436661
602ab54
 
1436661
602ab54
1436661
602ab54
 
 
1436661
602ab54
1436661
602ab54
1436661
602ab54
1436661
602ab54
 
 
 
1436661
76cfc21
1436661
602ab54
1436661
602ab54
1436661
602ab54
1436661
76cfc21
1436661
602ab54
1436661
69fb63a
602ab54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a7d84c
e7f32c9
 
 
602ab54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import streamlit as st
import numpy as np
import pickle
import streamlit.components.v1 as components
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
# Load the pickled model
def load_model():
    return pickle.load(open('StudentGradesPrediction_LinearRegresssion.pkl', 'rb'))#change

# Function for model prediction
def model_prediction(model, features):
    predicted = str(model.predict(features)[0])
    return predicted
le = LabelEncoder()
def transform1(text):
    text = le.fit_transform(text)
    return text[0]

def app_design():
    # Add input fields for High, Open, and Low values
    image = '37.png' #change
    st.image(image, use_column_width=True)
    
    st.subheader("Enter the following values:") #change
    
    school= st.number_input("School")
    school = transform1([school])
    sex= st.selectbox("sex",('Male','Female'))
    sex = transform1([sex])
    age= st.number_input("age")
    famsize= st.number_input("famsize")
    famsize = transform1([famsize])
    Pstatus= st.number_input("Pstatus")
    Pstatus = transform1([Pstatus])
    Medu= st.number_input("Medu")
    Fedu= st.number_input("Fedu")
    Mjob= st.number_input("Mjob")
    Mjob = transform1([Mjob])
    Fjob= st.number_input("Fjob")
    Fjob = transform1([Fjob])
    reason = st.number_input("reason")
    reason = transform1([reason])
    guardian= st.number_input("guardian")
    guardian = transform1([guardian])
    traveltime= st.number_input("traveltime")
    studytime= st.number_input("studytime")
    failures= st.number_input("failures")
    schoolsup= st.number_input("schoolsup")
    schoolsup = transform1([schoolsup])
    famsup= st.number_input("famsup")
    famsup = transform1([famsup])
    paid= st.number_input("paid")
    paid = transform1([paid])
    activities= st.number_input("activities")
    activities = transform1([activities])
    nursery= st.number_input("nursery")
    nursery = transform1([nursery])
    higher= st.number_input("higher")
    higher = transform1([higher])
    internet= st.number_input("internet")
    internet = transform1([internet])
    famrel= st.number_input("famrel")
    freetime= st.number_input("freetime")
    goout= st.number_input("goout")
    Dalc= st.number_input("Dalc")
    Walc= st.number_input("Walc")
    health= st.number_input("health")
    absences= st.number_input("absences")
    G1= st.number_input("G1")
    G2= st.number_input("G2")
    
    
 # Create a feature list from the user inputs
    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]]
    
    # Load the model
    model = load_model()
    
    # Make a prediction when the user clicks the "Predict" button
    if st.button('Predict Grade'):
        predicted_value = model_prediction(model, features)
        if '-' in predicted_value:
            st.success(f"Student Grade is: 0")    
        else:
            st.success(f"Student Grade 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="Student Gade Prediction",
        page_icon=":chart_with_upwards_trend:",
        )
    
        st.title("Welcome to our Student Grade Prediction App!")
    
        app_design()    
        st.header("About HiDevs Community")
        about_hidevs()

if __name__ == '__main__':
        main()