DataMine commited on
Commit
b77ed8a
·
verified ·
1 Parent(s): 14ed06b

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +44 -0
  2. requirements.txt +7 -0
  3. student_performance_model.h5 +3 -0
app.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import numpy as np
4
+ import joblib
5
+
6
+ # Load the trained model
7
+ model = joblib.load('student_performance_model.h5')
8
+ # Define the input features
9
+ def predict_marks(Hours_Studied,Previous_Scores,Extracurricular_Activities,Sleep_Hours,Sample_Question_Papers_Practiced):
10
+ input_data = np.array([[Hours_Studied,Previous_Scores,Extracurricular_Activities,Sleep_Hours,Sample_Question_Papers_Practiced]])
11
+ prediction = model.predict(input_data)
12
+ prediction = round(float(prediction), 2)
13
+
14
+ if prediction >= 100:
15
+ prediction = 100
16
+
17
+ return prediction
18
+
19
+ # Display the app title
20
+ def main():
21
+ st.title("Student Performance Prediction")
22
+ name = st.text_input("Enter your name:--")
23
+ Hours_Studied = st.number_input("Enter Number of hours you daily study:--",max_value=12,min_value=0,value=0)
24
+ Previous_Scores = st.number_input("Enter your previous scores:--",max_value=100.0,min_value=0.0,value=0.0)
25
+ Extracurricular_Activities = st.number_input("Enter the number of extracurricular activities you participate in:--",max_value=10,min_value=0,value=0)
26
+ Sleep_Hours= st.number_input("Enter the number of hours you sleep daily:--",max_value=12,min_value=0,value=0)
27
+ Sample_Question_Papers_Practiced= st.number_input("Enter the number of sample question papers you practice:--",max_value=100,min_value=0,value=0)
28
+
29
+ st.sidebar.title("Prediction")
30
+ st.sidebar.write(f"Hey, {name}")
31
+
32
+ if st.button("Result"):
33
+ prediction = predict_marks(Hours_Studied,Previous_Scores,Extracurricular_Activities,Sleep_Hours,Sample_Question_Papers_Practiced)
34
+ if prediction > 90:
35
+ st.success(f"Your predicted grade is A you are on a correct path with the estimated score of {prediction}.")
36
+ st.balloons()
37
+ elif prediction > 35:
38
+ st.warning(f"Your predicted grade is B you need to impove your estimated score is {prediction}.")
39
+ else:
40
+ st.error(f"Work hard your estimated score is {prediction}.")
41
+
42
+ if __name__ == "__main__":
43
+ main()
44
+
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ pandas
2
+ numpy
3
+ matplotlib
4
+ seaborn
5
+ streamlit
6
+ scikit-learn
7
+ joblib
student_performance_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4157ea9e74dc017119fd526cc588e579c595ba7ab8ba62f5b7213eec0316d811
3
+ size 1040