Unsupervised Learning Techniques
Unsupervised Learning Techniques
KNN is an algorithm which tries to find all the nearest neighbours for the given
data point. It
assumes similarity between new data and the available one and puts new data into
category that
is most similar to available categories. It can be used to solve problems of
classification as
well as regression.
Steps:-
16/11/22
Example:-
X1 x2 CLASS
8 4 A
4 5 B
4 6 B
7 7 A
5 6 B
6 5 A
Here the data given for both coordinates indicates the point belongs to either
class A or
class B. Consider point (7,4), here the question is to decide to which class (7,4)
belongs.
For finding class of (7,4) we must find the distance of this point with respect to
all
the given datapoints.
Here it means we will decide the class of point (7,4) by considering the class of
first nearest
neighbour.
Here we will take only first neighbour from the list since K = 1. The class for
that neighbour is
class A. Hence datapoint (7,4) belongs to class A.