Professional Documents
Culture Documents
73 80 Pass
92 88 Pass
89 91 Pass
96 98 Pass
50 45 Fail
71 80 Fail
60 62 Fail
78 68 Fail
Now, let's say we want to predict whether a student
with exam scores of 75 in Exam 1 and 70 in Exam 2 will
pass or fail.
73 80 Pass 10.20
92 88 Pass 20.39
89 91 Pass 22.36
96 98 Pass 31.14
50 45 Fail 31.62
71 80 Fail 6.08
60 62 Fail 10. 20
78 68 Fail 12 .81
73 80 Pass 10.20
71 80 Fail 6.08
60 62 Fail 10.20
Advantages of KNN:
Simplicity: KNN is a simple and intuitive algorithm that is
easy to understand and implement.
No training phase: KNN is a lazy learning algorithm, which
means it does not require an explicit training phase. It
memorizes the training data and uses it for classification or
regression directly.
Non-parametric: KNN makes no assumptions about the
underlying data distribution, making it suitable for both linear
and non-linear relationships.
Disadvantages of KNN: