Machine Learning Unit-3.1
Machine Learning Unit-3.1
• Training data is the past information with known value of class field or
‘label’.
• Hence, we say that the ‘training data is labelled’ in the case of supervised
learning.
• Example: Credit
scoring
• Differentiating
between low-risk
and high-risk
customers from their
income and savings
• Example: Price of a
used car
y = wx+w0
• x : car attributes
y : price
y = g (x | q )
g ( ) model,
q parameters
5
KNN Algorithm:
• The k-nearest neighbors (KNN) algorithm is
a simple,
easy-to-implement
supervised machine learning algorithm.
• Our KNN model will find the similar features of the new data set and
based on the most similar features, it will put it in either cat or dog
category.
• Why do we need a K-NN Algorithm?
• Suppose there are two categories, i.e., Category A and Category B, and
we have a new data point x1 (Input Value).
Step-4: Among these k neighbors, count the number of the data points
in each category.
Step-5: Assign the new data points to that category for which the
number of the neighbor is maximum.