DataMine commited on
Commit
1f5dc6e
·
verified ·
1 Parent(s): 95fd1bf

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +48 -0
  2. requirements.txt +4 -0
  3. student_performance_model.h5 +3 -0
app.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # Hours Studied Previous Scores Extracurricular Activities Sleep Hours Sample Question Papers Practiced Performance Index\
3
+
4
+ import numpy as np
5
+ import joblib
6
+ import streamlit as st
7
+
8
+
9
+
10
+ # Load the trained model
11
+ model = joblib.load(r"C:\Users\asgar\Downloads\machine learning HN\models\student_performance_model.h5")
12
+
13
+ def predict_marks(Hours_studied,Previous_Score,Extracurriculum_Activivities,Sleep_Hours,Sample_Question):
14
+ "predict the student marks based on the input data"
15
+ input_data = np.array([[Hours_studied,Previous_Score,Extracurriculum_Activivities,Sleep_Hours,Sample_Question]])
16
+ prediction= model.predict(input_data)
17
+ return round(float(prediction),2)
18
+
19
+ def main():
20
+ st.title("Student Marks Predictor")
21
+
22
+ #Input data
23
+ name = st.text_input("Enter your name")
24
+ Hours_studied = st.number_input("Enter the number of Hours you Studied", min_value=0.0,max_value=20.0,value=0.0)
25
+ Previous_Score = st.number_input("Enter your Previous exam Score", min_value=0,max_value=100,value=0)
26
+ Extracurriculum_Activivities = st.number_input("Enter the number extracurriculum activities you have done",min_value=0,max_value=10,value=0)
27
+ Sleep_Hours = st.number_input("Enter the number of hours you slept",min_value=0.0,max_value=12.0,value=0.0)
28
+ Sample_Question = st.number_input("Enter the number of Sample Question you have practiced",min_value=0,max_value=50,value=0)
29
+
30
+ # predict
31
+ st.sidebar.write(f"# hi {name}")
32
+ st.sidebar.write("##### i am a helpful students marks predictor here to assist you in predicting your marks")
33
+ if st.button("Predict"):
34
+ prediction = predict_marks(Hours_studied,Previous_Score,Extracurriculum_Activivities,Sleep_Hours,Sample_Question)
35
+
36
+ # Display the predictions
37
+ if prediction >=90:
38
+ st.success(f"{name} You have a high chances of passing with the the exceptional marks of {prediction} marks keep it up")
39
+ elif prediction >=35:
40
+ st.success(f"{name} You have chances of Passing with {prediction} marks try to get 90+")
41
+ else:
42
+ st.error(f"{name} You have a very high chances of failing")
43
+
44
+
45
+
46
+
47
+ if __name__=="__main__":
48
+ main()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ joblib==1.2.0
2
+ numpy==1.24.3
3
+ pandas==2.0.3
4
+ streamlit==1.37.0
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