Back to the 2021 paper

Module 3: Classification and Prediction

20214m

Using the dataset from Q5a, use your K-NN classifier to predict whether the following student (who overslept and missed the original exam) will pass the re-exam :

ID Cell No. Language Passed all Assignments GPA Passed Exam
9 93333-11109 C++ Yes 3.0 ??
Worked SolutionAI Assisted

Applying k-NN — Predict Student 9's Re-exam Result

Student 9 to classify

ID Language Passed all Assignments GPA Passed Exam
9 C++ Yes 3.0 ??

The training set is table Q5a; I use the features (GPA, Passed all Assignments, Language = C++) with the distance

d=(ΔGPA)2+(ΔAssign)2+(ΔLanguage)2d = \sqrt{(\Delta\text{GPA})^2 + (\Delta\text{Assign})^2 + (\Delta\text{Language})^2}

where mismatches count 1. (Normalisation is omitted here only for a clean illustration; in real use GPA would first be min–max normalised.)

Distances from student 9 to every training tuple

T Language Assign GPA Passed Exam ΔGPA ΔAssign ΔLang d
1 Java No 3.1 Yes 0.1 1 1 1.42
2 Java No 2.0 No 1.0 1 1 1.73
3 C++ Yes 3.5 Yes 0.5 0 0 0.50
4 Python Yes 2.5 Yes 0.5 0 1 1.12
5 Java Yes 3.9 No 0.9 0 1 1.35
6 C++ No 2.9 No 0.1 1 0 1.00
7 Java No 1.9 No 1.1 1 1 1.79
8 Python Yes 3.2 Yes 0.2 0 1 1.02

k = 3 nearest neighbours

Closest three tuples: #3 (d=0.50, Pass=Yes), #6 (d=1.00, Pass=No), #8 (d=1.02, Pass=Yes).

  • Voting: Yes (2) vs No (1) → majority class = Yes.

Answer

Student 9 (C++, passed all assignments, GPA 3.0) is predicted to PASS the re-exam under a k=3 nearest-neighbour classifier.

(Note: if GPA were normalised the ranking could shift slightly, but the closest student #3 — identical language, same assignment status, close GPA — strongly dominates the vote; the same conclusion typically holds for k=1, 3 and 5.)

Similar questions

Data MiningThe results of an exam are recorded along with some data about the students. The results can be found in the table below : | ID | Cell No. | Language | Passed all Assignments | GPA | Passed Exam | | :---: | :---: | :---: | :---: | :---: | :---: | | 1 | 93333-11101 | Java | No | 3.1 | Yes | | 2 | 93333-11112 | Java | No | 2.0 | No | | 3 | 93333-11102 | C++ | Yes | 3.5 | Yes | | 4 | 93333-11113 | Python | Yes | 2.5 | Yes | | 5 | 93333-11103 | Java | Yes | 3.9 | No | | 6 | 93333-11114 | C++ | No | 2.9 | No | | 7 | 93333-11104 | Java | No | 1.9 | No | | 8 | 93333-11115 | Python | Yes | 3.2 | Yes | In no more than one page of text, describe the design of a K-Nearest Neighbour classifier to predict if a student will fail or pass the exam.202110mDatabase Management SystemConsider: * Student(SID, Name, Dept, Age) * Course(CID, CName, Faculty) * Enroll(SID, CID, Marks) 1. Write relational algebra expressions to find: * a) Students enrolled in DBMS * b) Students scoring >80 marks * c) Students not enrolled in any course 2. Write SQL queries: * a) Find highest marks * b) Find average marks department-wise * c) Display students enrolled in more than two courses 3. Translate the following query into tuple relational calculus: * "Find names of students from CSE department." 4. Convert the following relational algebra into SQL: * \pi_{Name}(\sigma_{Marks > 85}(Student \bowtie Enroll))202510mDatabase Management SystemGiven the Students' relation as shown below: | StudentID | StudentName | StudentE-mail | StudentAge | CPI | |---|---|---|---|---| | 2345 | Shankar | shankar@math | X | 9.4 | | 1287 | Swati | swati@ee | 19 | 9.5 | | 7853 | Shankar | shankar@cse | 19 | 9.4 | | 9876 | Swati | swati@mech | 18 | 9.3 | | 8765 | Ganesh | ganesh@civil | 19 | 8.7 | For (StudentName, StudentAge) to be the key for this instance, the value X should not be equal to: (i) 18 (ii) 19 (iii) 15 (iv) 2020192mDatabase Management SystemWhich query is best solved using division operation? (i) Find students enrolled in DBMS (ii) Find students enrolled in all courses (iii) Find students with marks >80 (iv) Find students from CSE20252m
Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.