DataMine commited on
Commit
54ad043
ยท
verified ยท
1 Parent(s): 359a92f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -11
app.py CHANGED
@@ -9,8 +9,9 @@ def predict_marks(Hours_studied, Previous_Score, Extracurriculum_Activivities, S
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
- return round(float(prediction), 2)
13
-
 
14
  if prediction > 100:
15
  prediction = 100
16
 
@@ -18,7 +19,15 @@ def predict_marks(Hours_studied, Previous_Score, Extracurriculum_Activivities, S
18
 
19
  def main():
20
  # Sidebar Welcome Note with Emojis
21
-
 
 
 
 
 
 
 
 
22
 
23
  st.title("๐Ÿ“š Student Marks Predictor ๐Ÿ“Š")
24
 
@@ -31,15 +40,10 @@ def main():
31
  Sample_Question = st.number_input("โœ๏ธ Sample questions practiced", min_value=0, max_value=50, value=0)
32
 
33
  # Sidebar interaction
34
- st.sidebar.title(f"๐ŸŽ‰ # Welcome {name} \n to the Marks Oracle! ๐ŸŽ‰")
35
- st.sidebar.write("""
36
- **Prepare to be amazed** as this super-genius AI predicts your future marks with the accuracy of a caffeinated fortune cookie.
37
- Just enter how much you've studied (or napped ๐Ÿ˜ด), and let the magic happen!
38
 
39
- Remember, this AI never sleeps... but you should! ๐Ÿ˜‰
40
- """)
41
-
42
- st.sidebar.markdown("---")
43
  # Predict button
44
  if st.button("๐Ÿ”ฎ Predict Your Marks"):
45
  prediction = 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
 
 
19
 
20
  def main():
21
  # Sidebar Welcome Note with Emojis
22
+ st.sidebar.title("๐ŸŽ‰ Welcome to the Marks Oracle! ๐ŸŽ‰")
23
+ st.sidebar.write("""
24
+ **Prepare to be amazed** as this super-genius AI predicts your future marks with the accuracy of a caffeinated fortune cookie.
25
+ Just enter how much you've studied (or napped ๐Ÿ˜ด), and let the magic happen!
26
+
27
+ Remember, this AI never sleeps... but you should! ๐Ÿ˜‰
28
+ """)
29
+
30
+ st.sidebar.markdown("---")
31
 
32
  st.title("๐Ÿ“š Student Marks Predictor ๐Ÿ“Š")
33
 
 
40
  Sample_Question = st.number_input("โœ๏ธ Sample questions practiced", min_value=0, max_value=50, value=0)
41
 
42
  # Sidebar interaction
43
+ if name:
44
+ st.sidebar.write(f"### Welcome, **{name}**! ๐Ÿ‘‹")
45
+ st.sidebar.write("#### Let's check your upcoming marks by entering your details below.")
 
46
 
 
 
 
 
47
  # Predict button
48
  if st.button("๐Ÿ”ฎ Predict Your Marks"):
49
  prediction = predict_marks(Hours_studied, Previous_Score, Extracurriculum_Activivities, Sleep_Hours, Sample_Question)