tejaredddy commited on
Commit
ee66b65
·
verified ·
1 Parent(s): 010340d

Upload 6 files

Browse files
Files changed (1) hide show
  1. index.html +77 -0
index.html CHANGED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Student Performance Prediction</title>
5
+ <link rel="stylesheet" href="style.css">
6
+ </head>
7
+ <body>
8
+
9
+ <div class="container">
10
+ <h2>Student Performance Prediction</h2>
11
+
12
+ <label>Hours Studied:</label>
13
+ <input type="number" id="Hours_Studied">
14
+
15
+ <label>Attendance (%):</label>
16
+ <input type="number" id="Attendance">
17
+
18
+ <label>Previous Score:</label>
19
+ <input type="number" id="Previous_Scores">
20
+
21
+ <label>Sleep Hours:</label>
22
+ <input type="number" id="Sleep_Hours">
23
+
24
+ <label>Motivation Level (0–Low, 1–Medium, 2–High):</label>
25
+ <input type="number" id="Motivation_Level">
26
+
27
+ <label>Internet Access (0–No, 1–Yes):</label>
28
+ <input type="number" id="Internet_Access">
29
+
30
+ <label>Gender (0–Female, 1–Male):</label>
31
+ <input type="number" id="Gender">
32
+
33
+ <button onclick="predict()">Predict Exam Score</button>
34
+
35
+ <p id="result"></p>
36
+ </div>
37
+
38
+ <script>
39
+ function predict() {
40
+ document.getElementById("result").innerText = "Predicting...";
41
+
42
+ fetch("http://127.0.0.1:5000/predict", {
43
+ method: "POST",
44
+ headers: {
45
+ "Content-Type": "application/json"
46
+ },
47
+ body: JSON.stringify({
48
+ "Hours_Studied": Number(Hours_Studied.value),
49
+ "Attendance": Number(Attendance.value),
50
+ "Parental_Involvement": 2,
51
+ "Access_to_Resources": 2,
52
+ "Extracurricular_Activities": 1,
53
+ "Sleep_Hours": Number(Sleep_Hours.value),
54
+ "Previous_Scores": Number(Previous_Scores.value),
55
+ "Motivation_Level": Number(Motivation_Level.value),
56
+ "Internet_Access": Number(Internet_Access.value),
57
+ "Tutoring_Sessions": 1,
58
+ "Family_Income": 2,
59
+ "Teacher_Quality": 2,
60
+ "School_Type": 1,
61
+ "Peer_Influence": 1,
62
+ "Physical_Activity": 1,
63
+ "Learning_Disabilities": 0,
64
+ "Parental_Education_Level": 2,
65
+ "Distance_from_Home": 5,
66
+ "Gender": Number(Gender.value)
67
+ })
68
+ })
69
+ .then(res => res.json())
70
+ .then(data => {
71
+ result.innerText = "Predicted Exam Score: " + data.predicted_score;
72
+ });
73
+ }
74
+ </script>
75
+
76
+ </body>
77
+ </html>