Data Science & Machine Learning Prepare by – Manish
IT.mnchoudhary@gmail.com
+91-9910337960
Data Science & Machine Learning
KNN – Classification Model
Date 25th
Nov
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
KNN – K nearest neighbor is helping to split two or more categories efficiently .
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
Step 1 : Add new data point in between categories
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
Step 2 : K is nearest data point from new data point , distance calculate by Euclidean
distance by default k=5
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Step 3 : In K , Count how many data points follow to
which category to verify which Euclidean minimum
Distance from different existing data points to
new data point.
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
Real time scenarios like : customer attrite or not, should we target customer X for digital campaign
whether customer has a high potential or not etc. These analysis are more insightful and directly
links to an implementation roadmap.
KNN – K nearest neighbor is helping to split two or more categories efficiently .
When do we use KNN algorithm?
KNN can be used for both classification and regression predictive problems. However, it is more
widely used in classification problems in the industry. To evaluate any technique we generally look
at 3 important aspects:-
1. Ease to interpret output
2. Calculation time
3. Predictive Power
Note - KNN algorithm fairs across all parameters of considerations. It is commonly used for
its easy of interpretation and low calculation time.
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
How to measure distance of new point to existing data points
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
How to choose K boundary?
K influence in the algorithm. K=1 to 6 boundary was not so smooth for all red and blue
data point but k=7 when boundary become smoother. It means K will increase boundary
will become more smoother.
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
Error (Training Set) v/s Validation Error(Test Set)
Data Science
Prepared by Manish IT.mnchoudhary@gmail.com
Classification Model : K-NN
In Python, what is the class used to create a logistic regression classifier ?
•
Error (Training Set) v/s Validation Error(Test Set)

KNN - Classification Model (Step by Step)

  • 1.
    Data Science &Machine Learning Prepare by – Manish IT.mnchoudhary@gmail.com +91-9910337960 Data Science & Machine Learning KNN – Classification Model Date 25th Nov
  • 2.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • KNN – K nearest neighbor is helping to split two or more categories efficiently .
  • 3.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • Step 1 : Add new data point in between categories
  • 4.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • Step 2 : K is nearest data point from new data point , distance calculate by Euclidean distance by default k=5
  • 5.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Step 3 : In K , Count how many data points follow to which category to verify which Euclidean minimum Distance from different existing data points to new data point. Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? •
  • 6.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • Real time scenarios like : customer attrite or not, should we target customer X for digital campaign whether customer has a high potential or not etc. These analysis are more insightful and directly links to an implementation roadmap. KNN – K nearest neighbor is helping to split two or more categories efficiently . When do we use KNN algorithm? KNN can be used for both classification and regression predictive problems. However, it is more widely used in classification problems in the industry. To evaluate any technique we generally look at 3 important aspects:- 1. Ease to interpret output 2. Calculation time 3. Predictive Power Note - KNN algorithm fairs across all parameters of considerations. It is commonly used for its easy of interpretation and low calculation time.
  • 7.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • How to measure distance of new point to existing data points
  • 8.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • How to choose K boundary? K influence in the algorithm. K=1 to 6 boundary was not so smooth for all red and blue data point but k=7 when boundary become smoother. It means K will increase boundary will become more smoother.
  • 9.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • Error (Training Set) v/s Validation Error(Test Set)
  • 10.
    Data Science Prepared byManish IT.mnchoudhary@gmail.com Classification Model : K-NN In Python, what is the class used to create a logistic regression classifier ? • Error (Training Set) v/s Validation Error(Test Set)