File size: 2,124 Bytes
9128296
 
 
 
 
 
 
 
 
 
5e8e884
9128296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

# Hours Studied	Previous Scores	Extracurricular Activities	Sleep Hours	Sample Question Papers Practiced	Performance Index\

import numpy as np
import joblib
import streamlit as st



# Load the trained model
model = joblib.load("student_performance_model.h5")

def predict_marks(Hours_studied,Previous_Score,Extracurriculum_Activivities,Sleep_Hours,Sample_Question):
    "predict the student marks based on the input data"
    input_data = np.array([[Hours_studied,Previous_Score,Extracurriculum_Activivities,Sleep_Hours,Sample_Question]])
    prediction= model.predict(input_data)
    return round(float(prediction),2)

def main():
    st.title("Student Marks Predictor")

    #Input data
    name = st.text_input("Enter your name")
    Hours_studied = st.number_input("Enter the number of Hours you Studied", min_value=0.0,max_value=20.0,value=0.0)
    Previous_Score = st.number_input("Enter your Previous exam Score", min_value=0,max_value=100,value=0)
    Extracurriculum_Activivities = st.number_input("Enter the number extracurriculum activities you have done",min_value=0,max_value=10,value=0)
    Sleep_Hours = st.number_input("Enter the number of hours you slept",min_value=0.0,max_value=12.0,value=0.0)
    Sample_Question = st.number_input("Enter the number of Sample Question you have practiced",min_value=0,max_value=50,value=0)

    # predict
    st.sidebar.write(f"# hi {name}")
    st.sidebar.write("##### i am a helpful students marks predictor here to assist you in predicting your marks")
    if st.button("Predict"):
        prediction = predict_marks(Hours_studied,Previous_Score,Extracurriculum_Activivities,Sleep_Hours,Sample_Question)

        # Display the predictions
        if prediction >=90:
            st.success(f"{name} You have a high chances of passing with the the exceptional marks of {prediction} marks keep it up")
        elif prediction >=35:
            st.success(f"{name} You have chances of Passing with {prediction} marks try to get 90+")
        else:
            st.error(f"{name} You have a very high chances of failing")    




if __name__=="__main__":
    main()