DataMine commited on
Commit
49fb3a4
ยท
verified ยท
1 Parent(s): 250475f

Upload 3 files

Browse files
app (1).py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import joblib
3
+ import streamlit as st
4
+
5
+ # Load the trained model
6
+ model = joblib.load("student_performance_model.h5")
7
+
8
+ def predict_marks(Hours_studied, Previous_Score, Extracurriculum_Activivities, Sleep_Hours, Sample_Question):
9
+ "Predict the student marks based on the input data"
10
+ input_data = np.array([[Hours_studied, Previous_Score, Extracurriculum_Activivities, Sleep_Hours, Sample_Question]])
11
+ prediction = model.predict(input_data)
12
+ prediction = round(float(prediction), 2)
13
+
14
+ # Ensure the prediction does not exceed 100
15
+ if prediction > 100:
16
+ prediction = 100
17
+
18
+ return prediction
19
+
20
+ def main():
21
+ # Sidebar Welcome Note with Emojis
22
+
23
+
24
+ st.title("๐Ÿ“š Student Marks Predictor ๐Ÿ“Š")
25
+
26
+ # Input data
27
+ name = st.text_input("๐Ÿ‘ค Enter your name")
28
+ Hours_studied = st.number_input("๐Ÿ“– Hours you studied", min_value=0.0, max_value=20.0, value=0.0)
29
+ Previous_Score = st.number_input("๐Ÿ“Š Previous exam score", min_value=0, max_value=100, value=0)
30
+ Extracurriculum_Activivities = st.number_input("๐ŸŽญ Extracurricular activities done", min_value=0, max_value=10, value=0)
31
+ Sleep_Hours = st.number_input("๐Ÿ˜ด Hours you slept", min_value=0.0, max_value=12.0, value=0.0)
32
+ Sample_Question = st.number_input("โœ๏ธ Sample questions practiced", min_value=0, max_value=50, value=0)
33
+
34
+ # Sidebar interaction
35
+ st.sidebar.title(f" # Hey {name}")
36
+ st.sidebar.title(f"๐ŸŽ‰Welcome to your Marks Predictor! ๐ŸŽ‰")
37
+ st.sidebar.write("""
38
+ Hey there! Ready to see what your future marks might be? ๐Ÿ˜„
39
+
40
+ Remember, I'm here to help you succeed! ๐Ÿ’ช
41
+ """)
42
+
43
+ st.sidebar.markdown("---")
44
+
45
+ # Predict button
46
+ if st.button("๐Ÿ”ฎ Predict Your Marks"):
47
+ prediction = predict_marks(Hours_studied, Previous_Score, Extracurriculum_Activivities, Sleep_Hours, Sample_Question)
48
+
49
+ # Display the predictions
50
+ if prediction >= 90:
51
+ st.balloons()
52
+ st.success(f"๐ŸŒŸ **{name}, amazing!** You're on track to score {prediction} marks! Keep up the excellent work! ๐Ÿ’ช")
53
+ elif prediction >= 35:
54
+ st.warning(f"โš ๏ธ **{name}, not bad!** You're likely to pass with {prediction} marks, but there's room to aim higher! ๐Ÿš€")
55
+ else:
56
+ st.error(f"๐Ÿšจ **{name}, oh no!** You might score below 35 marks. Consider putting in some more effort! ๐Ÿ“š")
57
+
58
+ if __name__ == "__main__":
59
+ main()
requirements (1).txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ joblib==1.2.0
2
+ numpy==1.24.3
3
+ pandas==2.0.3
4
+ streamlit==1.37.0
5
+ scikit-learn
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