SlideShare a Scribd company logo
KNN Classification
Algorithm
What’s in it for you?
Why do we need KNN?
What is KNN?
How do we choose the factor ‘K’?
When do we use KNN?
How does KNN Algorithm work?
Use Case: Predict whether a person will have diabetes or
not
Why KNN?
By now, we all know
Machine learning models
makes predictions by
learning from the past
data available
Input value
Machine Learning Model
Predicted Output
Is that a dog?
No dear, you can
differentiate
between a cat
and a dog based
on their
characteristics
No dear, you can
differentiate
between a cat
and a dog based
on their
characteristics
DOGSCATS
Sharp Claws, uses to climb
Smaller length of ears
Meows and purrs
Doesn’t love to play around
Dull Claws
Bigger length of ears
Barks
Loves to run around
No dear, you can
differentiate
between a cat
and a dog based
on their
characteristics
DOGSCATS
Length of ears 
Sharpnessofclaws
Now tell me if it
is a cat or a dog?
Now tell me if
it’s a cat or a
dog?
DOGSCATS
Length of ears 
Sharpnessofclaws
It’s features are
more like cats, it
must be a cat!
DOGSCATS
Length of ears 
Sharpofclaws
Why KNN?
Because KNN is based on
feature similarity, we can
do classification using KNN
Classifier!
Input value
KNN
Predicted Output
What is KNN?
What is KNN Algorithm?
KNN – K Nearest Neighbors, is one of the simplest Supervised Machine Learning algorithm
mostly used for
Classification
It classifies a data point based on how its
neighbors are classified
What is KNN Algorithm?
KNN stores all available cases and
classifies new cases based on a
similarity measure
Chloride Level 
SulphurDioxideLevel
RED or WHITE?
What is KNN Algorithm?
But, what is K?
Chloride Level 
SulphurDioxideLevel
RED or WHITE?
What is KNN Algorithm?
RED or WHITE?
k in KNN is a parameter that refers
to the number of nearest neighbors
to include in the majority voting
process
K=5
Chloride Level 
SulphurDioxideLevel
What is KNN Algorithm?
RED or WHITE?
A data point is classified by majority
votes from its 5 nearest neighbors
K=5
Chloride Level 
SulphurDioxideLevel
What is KNN Algorithm?
Chloride Level 
SulphurDioxideLevel RED
Here, the unknown point would be
classified as red, since 4 out of 5
neighbors are red
K=5
How do we choose ‘k’?
How do we choose the factor ‘k’?
?
K=3
New
Variable
KNN Algorithm is based on feature similarity: Choosing the right value of k is a process
called parameter tuning, and is important for better accuracy
How do we choose the factor ‘k’?
?
k=3
New
Variable
KNN Algorithm is based on feature similarity: Choosing the right value of k is a process
called parameter tuning, and is important for better accuracy
So at k=3, we can classify ‘?’ as
How do we choose the factor ‘k’?
?
k=3
k=7
New
Variable
KNN Algorithm is based on feature similarity: Choosing the right value of k is a process
called parameter tuning, and is important for better accuracy
But at k=7, we classify ‘?’ as
How do we choose the factor ‘k’?
?
K=1
K=3
New
Variable
KNN Algorithm is based on feature similarity: Choosing the right value of k is a process
called parameter tuning, and is important for better accuracy
So at k=3, we can classify ‘?’ as
The class of unknown data
point was at k=3 but
changed at k=7, so which k
should we choose?
How do we choose the factor ‘k’?
Odd value of K is selected to avoid confusion between two classes of data
Sqrt(n), where n is the total number of data points
To choose a value of k:
How do we choose the factor ‘k’?
Odd value of K is selected to avoid confusion between two classes of data
Sqrt(n), where n is the total number of data points
To choose a value of k:
Higher value of k has lesser
chance of error
When do we use KNN?
When do we use KNN Algorithm?
We can use KNN when
Dog
Data is labeled
When do we use KNN Algorithm?
We can use KNN when
Data is noise free
Data is labeled
Dog
Noise
Weight(x2) Height(y2) Class
51 167Underweight
62 182 one-fourty
69 176 23
64 173 hello kitty
65 172 Normal
When do we use KNN Algorithm?
We can use KNN when
Data is noise freeDataset is small
Data is labeled
Dog
Because KNN is a ‘lazy learner’ i.e.
doesn’t learn a discriminative function
from the training set
Noise
Weight(x2) Height(y2) Class
51 167Underweight
62 182 one-fourty
69 176 23
64 173 hello kitty
65 172 Normal
How does KNN Algorithm work?
How does KNN Algorithm work?
Consider a dataset having two variables: height (cm) & weight (kg) and each point is
classified as Normal or Underweight
Weight(x2) Height(y2) Class
51 167 Underweight
62 182 Normal
69 176 Normal
64 173 Normal
65 172 Normal
56 174 Underweight
58 169 Normal
57 173 Normal
55 170 Normal
How does KNN Algorithm work?
On the basis of the given data we have to classify the below set as Normal or
Underweight using KNN
Assuming, we
don’t know how to
calculate BMI!
57 kg 170 cm ?
How does KNN Algorithm work?
To find the nearest neighbors, we will calculate Euclidean
distance
But, what is
Euclidean distance?
How does KNN Algorithm work?
According to the Euclidean distance formula, the distance between two points in the plane with
coordinates (x, y) and (a, b) is given by:
dist(d)= √(x - a)² + (y - b)²
How does KNN Algorithm work?
Let’s calculate it to understand clearly:
Similarly, we will calculate Euclidean distance of unknown data point from
all the points in the dataset
dist(d1)= √(170-167)² + (57-51)² ~= 6.7
d1
dist(d2)= √(170-182)² + (57-62)² ~= 13
d2
dist(d3)= √(170-176)² + (57-69)² ~= 13.4
d3
Unknown data point
How does KNN Algorithm work?
Hence, we have calculated the Euclidean distance of unknown data point from all
the points as shown:
Where (x1, y1) = (57, 170) whose
class we have to classify
Weight(x2) Height(y2) Class Euclidean Distance
51 167 Underweight 6.7
62 182 Normal 13
69 176 Normal 13.4
64 173 Normal 7.6
65 172 Normal 8.2
56 174 Underweight 4.1
58 169 Normal 1.4
57 173 Normal 3
55 170 Normal 2
How does KNN Algorithm work?
Now, lets calculate the nearest neighbor at k=3
k = 3
57 kg 170 cm ?
Weight(x2) Height(y2) Class Euclidean Distance
51 167 Underweight 6.7
62 182 Normal 13
69 176 Normal 13.4
64 173 Normal 7.6
65 172 Normal 8.2
56 174 Underweight 4.1
58 169 Normal 1.4
57 173 Normal 3
55 170 Normal 2
Weight(x2) Height(y2) Class Euclidean Distance
51 167 Underweight 6.7
62 182 Normal 13
69 176 Normal 13.4
64 173 Normal 7.6
65 172 Normal 8.2
56 174 Underweight 4.1
58 169 Normal 1.4
57 173 Normal 3
55 170 Normal 2
How does KNN Algorithm work?
Now, lets calculate the nearest neighbor at k=3
k = 3
57 kg 170 cm ?
We have n=10,
And sqrt(10)=3.1
Hence, we have taken k=3
How does KNN Algorithm work?
So, majority neighbors are pointing towards ‘Normal’
Hence, as per KNN algorithm the class of (57, 170) should be ‘Normal’
k = 3
Class Euclidean Distance
Underweight 6.7
Normal 13
Normal 13.4
Normal 7.6
Normal 8.2
Underweight 4.1
Normal 1.4
Normal 3
Normal 2
Recap of KNN
Recap of KNN
• A positive integer k is specified, along with
a new sample
• We select the k entries in our database
which are closest to the new sample
• We find the most common classification of
these entries
• This is the classification we give to the
new sample
USE CASE: Predict Diabetes
KNN - Predict diabetes
Objective: Predict whether a person will be diagnosed with diabetes or not
We have a dataset of 768 people who were or were not
diagnosed with diabetes
KNN - Predict diabetes
Import the required Scikit-learn libraries as shown:
KNN - Predict diabetes
Load the dataset and have a look:
KNN - Predict diabetes
Values of columns like ‘Glucose’, BloodPressure’ cannot be accepted as zeroes because it will affect the outcome
We can replace such values with the mean of the respective column:
KNN - Predict diabetes
Before proceeding further, let’s split the dataset into train and test:
KNN - Predict diabetes
Feature Scaling:
Rule of thumb: Any algorithm that
computes distance or assumes
normality, scale your features!
KNN - Predict diabetes
Then define the model using KNeighborsClassifier and fit the train data in
the model
N_neighbors here is ‘K’
p is the power parameter to define
the metric used, which is ‘Euclidean’
in our case
KNN - Predict diabetes
There are other metrics
also to evaluate the
distance like Manhattan
distance , Minkowski
distance etc
KNN - Predict diabetes
Let’s predict the test results:
KNN - Predict diabetes
It’s important to evaluate the model, let’s use confusion matrix to do that:
KNN - Predict diabetes
Calculate accuracy of the model:
KNN - Predict diabetes
So, we have created a model using
KNN which can predict whether a
person will have diabetes or not
KNN - Predict diabetes
And accuracy of 80% tells us that it is
a pretty fair fit in the model!
Summary
Why we need knn? Eucledian distance Choosing the value of k
Knn classifier for diabetes predictionHow KNN works?
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Beginners | Simplilearn

More Related Content

What's hot (20)

K means Clustering Algorithm
K means Clustering AlgorithmK means Clustering Algorithm
K means Clustering Algorithm
Kasun Ranga Wijeweera
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
Ashraf Uddin
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
parry prabhu
 
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
Simplilearn
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Simplilearn
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
Knoldus Inc.
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
Mohammad Junaid Khan
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
Simplilearn
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
Md. Main Uddin Rony
 
2.5 backpropagation
2.5 backpropagation2.5 backpropagation
2.5 backpropagation
Krish_ver2
 
K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)
Abdullah al Mamun
 
Data Mining: Association Rules Basics
Data Mining: Association Rules BasicsData Mining: Association Rules Basics
Data Mining: Association Rules Basics
Benazir Income Support Program (BISP)
 
k medoid clustering.pptx
k medoid clustering.pptxk medoid clustering.pptx
k medoid clustering.pptx
Roshan86572
 
Knn 160904075605-converted
Knn 160904075605-convertedKnn 160904075605-converted
Knn 160904075605-converted
rameswara reddy venkat
 
What is Machine Learning | Introduction to Machine Learning | Machine Learnin...
What is Machine Learning | Introduction to Machine Learning | Machine Learnin...What is Machine Learning | Introduction to Machine Learning | Machine Learnin...
What is Machine Learning | Introduction to Machine Learning | Machine Learnin...
Simplilearn
 
Knn
KnnKnn
Knn
YashwantGahlot1
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
Kamal Acharya
 
Density based clustering
Density based clusteringDensity based clustering
Density based clustering
YaswanthHariKumarVud
 
Presentation on K-Means Clustering
Presentation on K-Means ClusteringPresentation on K-Means Clustering
Presentation on K-Means Clustering
Pabna University of Science & Technology
 
DBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmDBSCAN : A Clustering Algorithm
DBSCAN : A Clustering Algorithm
Pınar Yahşi
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
parry prabhu
 
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
Naive Bayes Classifier | Naive Bayes Algorithm | Naive Bayes Classifier With ...
Simplilearn
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Simplilearn
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
Knoldus Inc.
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
Mohammad Junaid Khan
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
Simplilearn
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
Md. Main Uddin Rony
 
2.5 backpropagation
2.5 backpropagation2.5 backpropagation
2.5 backpropagation
Krish_ver2
 
k medoid clustering.pptx
k medoid clustering.pptxk medoid clustering.pptx
k medoid clustering.pptx
Roshan86572
 
What is Machine Learning | Introduction to Machine Learning | Machine Learnin...
What is Machine Learning | Introduction to Machine Learning | Machine Learnin...What is Machine Learning | Introduction to Machine Learning | Machine Learnin...
What is Machine Learning | Introduction to Machine Learning | Machine Learnin...
Simplilearn
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
Kamal Acharya
 
DBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmDBSCAN : A Clustering Algorithm
DBSCAN : A Clustering Algorithm
Pınar Yahşi
 

Similar to KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Beginners | Simplilearn (20)

KNN Classificationwithexplanation and examples.pptx
KNN Classificationwithexplanation and examples.pptxKNN Classificationwithexplanation and examples.pptx
KNN Classificationwithexplanation and examples.pptx
ansarinazish958
 
Machine Learning Algorithm - KNN
Machine Learning Algorithm - KNNMachine Learning Algorithm - KNN
Machine Learning Algorithm - KNN
Kush Kulshrestha
 
Statistical Machine Learning unit3 lecture notes
Statistical Machine Learning unit3 lecture notesStatistical Machine Learning unit3 lecture notes
Statistical Machine Learning unit3 lecture notes
SureshK256753
 
tghteh ddh4eth rtnrtrgthgh12500123196.pdf
tghteh ddh4eth rtnrtrgthgh12500123196.pdftghteh ddh4eth rtnrtrgthgh12500123196.pdf
tghteh ddh4eth rtnrtrgthgh12500123196.pdf
NidhiKumari899659
 
K- Nearest Neighbor Approach
K- Nearest Neighbor ApproachK- Nearest Neighbor Approach
K- Nearest Neighbor Approach
Kumud Arora
 
Data Science Job Required Skill Analysis
Data Science Job Required Skill AnalysisData Science Job Required Skill Analysis
Data Science Job Required Skill Analysis
Harsh Kevadia
 
k-nearest neighbour Machine Learning.pdf
k-nearest neighbour Machine Learning.pdfk-nearest neighbour Machine Learning.pdf
k-nearest neighbour Machine Learning.pdf
SabbirAhmed346057
 
k-nearest neighbour Machine Learning.pptx
k-nearest neighbour Machine Learning.pptxk-nearest neighbour Machine Learning.pptx
k-nearest neighbour Machine Learning.pptx
SabbirAhmed346057
 
Scalable k-means plus plus
Scalable k-means plus plusScalable k-means plus plus
Scalable k-means plus plus
Prabin Giri, PhD Student
 
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
Edureka!
 
Ensemble_instance_unsupersied_learning 01_02_2024.pptx
Ensemble_instance_unsupersied_learning 01_02_2024.pptxEnsemble_instance_unsupersied_learning 01_02_2024.pptx
Ensemble_instance_unsupersied_learning 01_02_2024.pptx
vigneshmatta2004
 
K nearest neighbor algorithm
  K nearest neighbor algorithm  K nearest neighbor algorithm
K nearest neighbor algorithm
Learnbay Datascience
 
K nearest neighbor: classify by closest training points.
K nearest neighbor: classify by closest training points.K nearest neighbor: classify by closest training points.
K nearest neighbor: classify by closest training points.
mcafarewell2e
 
Ml9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsMl9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methods
ankit_ppt
 
Clustering.pptx
Clustering.pptxClustering.pptx
Clustering.pptx
19526YuvaKumarIrigi
 
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptxKNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
Nishant83346
 
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lfMLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
1052LaxmanrajS
 
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomfMLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
1052LaxmanrajS
 
Instance Based Learning in machine learning
Instance Based Learning in machine learningInstance Based Learning in machine learning
Instance Based Learning in machine learning
tanishqgujari
 
K means clustering algorithm
K means clustering algorithmK means clustering algorithm
K means clustering algorithm
Darshak Mehta
 
KNN Classificationwithexplanation and examples.pptx
KNN Classificationwithexplanation and examples.pptxKNN Classificationwithexplanation and examples.pptx
KNN Classificationwithexplanation and examples.pptx
ansarinazish958
 
Machine Learning Algorithm - KNN
Machine Learning Algorithm - KNNMachine Learning Algorithm - KNN
Machine Learning Algorithm - KNN
Kush Kulshrestha
 
Statistical Machine Learning unit3 lecture notes
Statistical Machine Learning unit3 lecture notesStatistical Machine Learning unit3 lecture notes
Statistical Machine Learning unit3 lecture notes
SureshK256753
 
tghteh ddh4eth rtnrtrgthgh12500123196.pdf
tghteh ddh4eth rtnrtrgthgh12500123196.pdftghteh ddh4eth rtnrtrgthgh12500123196.pdf
tghteh ddh4eth rtnrtrgthgh12500123196.pdf
NidhiKumari899659
 
K- Nearest Neighbor Approach
K- Nearest Neighbor ApproachK- Nearest Neighbor Approach
K- Nearest Neighbor Approach
Kumud Arora
 
Data Science Job Required Skill Analysis
Data Science Job Required Skill AnalysisData Science Job Required Skill Analysis
Data Science Job Required Skill Analysis
Harsh Kevadia
 
k-nearest neighbour Machine Learning.pdf
k-nearest neighbour Machine Learning.pdfk-nearest neighbour Machine Learning.pdf
k-nearest neighbour Machine Learning.pdf
SabbirAhmed346057
 
k-nearest neighbour Machine Learning.pptx
k-nearest neighbour Machine Learning.pptxk-nearest neighbour Machine Learning.pptx
k-nearest neighbour Machine Learning.pptx
SabbirAhmed346057
 
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
Edureka!
 
Ensemble_instance_unsupersied_learning 01_02_2024.pptx
Ensemble_instance_unsupersied_learning 01_02_2024.pptxEnsemble_instance_unsupersied_learning 01_02_2024.pptx
Ensemble_instance_unsupersied_learning 01_02_2024.pptx
vigneshmatta2004
 
K nearest neighbor: classify by closest training points.
K nearest neighbor: classify by closest training points.K nearest neighbor: classify by closest training points.
K nearest neighbor: classify by closest training points.
mcafarewell2e
 
Ml9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsMl9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methods
ankit_ppt
 
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptxKNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
Nishant83346
 
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lfMLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
1052LaxmanrajS
 
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomfMLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
1052LaxmanrajS
 
Instance Based Learning in machine learning
Instance Based Learning in machine learningInstance Based Learning in machine learning
Instance Based Learning in machine learning
tanishqgujari
 
K means clustering algorithm
K means clustering algorithmK means clustering algorithm
K means clustering algorithm
Darshak Mehta
 
Ad

More from Simplilearn (20)

Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Simplilearn
 
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Simplilearn
 
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Simplilearn
 
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
Simplilearn
 
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
Simplilearn
 
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
Simplilearn
 
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Simplilearn
 
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
Simplilearn
 
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
Simplilearn
 
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Simplilearn
 
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Simplilearn
 
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Simplilearn
 
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
Simplilearn
 
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Simplilearn
 
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Simplilearn
 
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Simplilearn
 
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Simplilearn
 
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Simplilearn
 
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Simplilearn
 
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
Simplilearn
 
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
Simplilearn
 
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
Simplilearn
 
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Simplilearn
 
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
Simplilearn
 
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
Simplilearn
 
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Simplilearn
 
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Simplilearn
 
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Simplilearn
 
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
Simplilearn
 
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Simplilearn
 
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Simplilearn
 
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Simplilearn
 
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 
Ad

Recently uploaded (20)

MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation SamplerLDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptxPEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdfIntroduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil DisobediencePaper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
Quiz Club of PSG College of Arts & Science
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdfABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive LearningSustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Chalukyas of Gujrat, Solanki Dynasty NEP.pptxChalukyas of Gujrat, Solanki Dynasty NEP.pptx
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptxSPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptxROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke WarnerPublishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation SamplerLDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptxPEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdfIntroduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil DisobediencePaper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdfABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive LearningSustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptxSPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptxROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke WarnerPublishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 

KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Beginners | Simplilearn

  • 2. What’s in it for you? Why do we need KNN? What is KNN? How do we choose the factor ‘K’? When do we use KNN? How does KNN Algorithm work? Use Case: Predict whether a person will have diabetes or not
  • 3. Why KNN? By now, we all know Machine learning models makes predictions by learning from the past data available Input value Machine Learning Model Predicted Output
  • 4. Is that a dog?
  • 5. No dear, you can differentiate between a cat and a dog based on their characteristics
  • 6. No dear, you can differentiate between a cat and a dog based on their characteristics DOGSCATS Sharp Claws, uses to climb Smaller length of ears Meows and purrs Doesn’t love to play around Dull Claws Bigger length of ears Barks Loves to run around
  • 7. No dear, you can differentiate between a cat and a dog based on their characteristics DOGSCATS Length of ears  Sharpnessofclaws
  • 8. Now tell me if it is a cat or a dog?
  • 9. Now tell me if it’s a cat or a dog? DOGSCATS Length of ears  Sharpnessofclaws
  • 10. It’s features are more like cats, it must be a cat!
  • 11. DOGSCATS Length of ears  Sharpofclaws
  • 12. Why KNN? Because KNN is based on feature similarity, we can do classification using KNN Classifier! Input value KNN Predicted Output
  • 14. What is KNN Algorithm? KNN – K Nearest Neighbors, is one of the simplest Supervised Machine Learning algorithm mostly used for Classification It classifies a data point based on how its neighbors are classified
  • 15. What is KNN Algorithm? KNN stores all available cases and classifies new cases based on a similarity measure Chloride Level  SulphurDioxideLevel RED or WHITE?
  • 16. What is KNN Algorithm? But, what is K? Chloride Level  SulphurDioxideLevel RED or WHITE?
  • 17. What is KNN Algorithm? RED or WHITE? k in KNN is a parameter that refers to the number of nearest neighbors to include in the majority voting process K=5 Chloride Level  SulphurDioxideLevel
  • 18. What is KNN Algorithm? RED or WHITE? A data point is classified by majority votes from its 5 nearest neighbors K=5 Chloride Level  SulphurDioxideLevel
  • 19. What is KNN Algorithm? Chloride Level  SulphurDioxideLevel RED Here, the unknown point would be classified as red, since 4 out of 5 neighbors are red K=5
  • 20. How do we choose ‘k’?
  • 21. How do we choose the factor ‘k’? ? K=3 New Variable KNN Algorithm is based on feature similarity: Choosing the right value of k is a process called parameter tuning, and is important for better accuracy
  • 22. How do we choose the factor ‘k’? ? k=3 New Variable KNN Algorithm is based on feature similarity: Choosing the right value of k is a process called parameter tuning, and is important for better accuracy So at k=3, we can classify ‘?’ as
  • 23. How do we choose the factor ‘k’? ? k=3 k=7 New Variable KNN Algorithm is based on feature similarity: Choosing the right value of k is a process called parameter tuning, and is important for better accuracy But at k=7, we classify ‘?’ as
  • 24. How do we choose the factor ‘k’? ? K=1 K=3 New Variable KNN Algorithm is based on feature similarity: Choosing the right value of k is a process called parameter tuning, and is important for better accuracy So at k=3, we can classify ‘?’ as The class of unknown data point was at k=3 but changed at k=7, so which k should we choose?
  • 25. How do we choose the factor ‘k’? Odd value of K is selected to avoid confusion between two classes of data Sqrt(n), where n is the total number of data points To choose a value of k:
  • 26. How do we choose the factor ‘k’? Odd value of K is selected to avoid confusion between two classes of data Sqrt(n), where n is the total number of data points To choose a value of k: Higher value of k has lesser chance of error
  • 27. When do we use KNN?
  • 28. When do we use KNN Algorithm? We can use KNN when Dog Data is labeled
  • 29. When do we use KNN Algorithm? We can use KNN when Data is noise free Data is labeled Dog Noise Weight(x2) Height(y2) Class 51 167Underweight 62 182 one-fourty 69 176 23 64 173 hello kitty 65 172 Normal
  • 30. When do we use KNN Algorithm? We can use KNN when Data is noise freeDataset is small Data is labeled Dog Because KNN is a ‘lazy learner’ i.e. doesn’t learn a discriminative function from the training set Noise Weight(x2) Height(y2) Class 51 167Underweight 62 182 one-fourty 69 176 23 64 173 hello kitty 65 172 Normal
  • 31. How does KNN Algorithm work?
  • 32. How does KNN Algorithm work? Consider a dataset having two variables: height (cm) & weight (kg) and each point is classified as Normal or Underweight Weight(x2) Height(y2) Class 51 167 Underweight 62 182 Normal 69 176 Normal 64 173 Normal 65 172 Normal 56 174 Underweight 58 169 Normal 57 173 Normal 55 170 Normal
  • 33. How does KNN Algorithm work? On the basis of the given data we have to classify the below set as Normal or Underweight using KNN Assuming, we don’t know how to calculate BMI! 57 kg 170 cm ?
  • 34. How does KNN Algorithm work? To find the nearest neighbors, we will calculate Euclidean distance But, what is Euclidean distance?
  • 35. How does KNN Algorithm work? According to the Euclidean distance formula, the distance between two points in the plane with coordinates (x, y) and (a, b) is given by: dist(d)= √(x - a)² + (y - b)²
  • 36. How does KNN Algorithm work? Let’s calculate it to understand clearly: Similarly, we will calculate Euclidean distance of unknown data point from all the points in the dataset dist(d1)= √(170-167)² + (57-51)² ~= 6.7 d1 dist(d2)= √(170-182)² + (57-62)² ~= 13 d2 dist(d3)= √(170-176)² + (57-69)² ~= 13.4 d3 Unknown data point
  • 37. How does KNN Algorithm work? Hence, we have calculated the Euclidean distance of unknown data point from all the points as shown: Where (x1, y1) = (57, 170) whose class we have to classify Weight(x2) Height(y2) Class Euclidean Distance 51 167 Underweight 6.7 62 182 Normal 13 69 176 Normal 13.4 64 173 Normal 7.6 65 172 Normal 8.2 56 174 Underweight 4.1 58 169 Normal 1.4 57 173 Normal 3 55 170 Normal 2
  • 38. How does KNN Algorithm work? Now, lets calculate the nearest neighbor at k=3 k = 3 57 kg 170 cm ? Weight(x2) Height(y2) Class Euclidean Distance 51 167 Underweight 6.7 62 182 Normal 13 69 176 Normal 13.4 64 173 Normal 7.6 65 172 Normal 8.2 56 174 Underweight 4.1 58 169 Normal 1.4 57 173 Normal 3 55 170 Normal 2
  • 39. Weight(x2) Height(y2) Class Euclidean Distance 51 167 Underweight 6.7 62 182 Normal 13 69 176 Normal 13.4 64 173 Normal 7.6 65 172 Normal 8.2 56 174 Underweight 4.1 58 169 Normal 1.4 57 173 Normal 3 55 170 Normal 2 How does KNN Algorithm work? Now, lets calculate the nearest neighbor at k=3 k = 3 57 kg 170 cm ? We have n=10, And sqrt(10)=3.1 Hence, we have taken k=3
  • 40. How does KNN Algorithm work? So, majority neighbors are pointing towards ‘Normal’ Hence, as per KNN algorithm the class of (57, 170) should be ‘Normal’ k = 3 Class Euclidean Distance Underweight 6.7 Normal 13 Normal 13.4 Normal 7.6 Normal 8.2 Underweight 4.1 Normal 1.4 Normal 3 Normal 2
  • 41. Recap of KNN Recap of KNN • A positive integer k is specified, along with a new sample • We select the k entries in our database which are closest to the new sample • We find the most common classification of these entries • This is the classification we give to the new sample
  • 42. USE CASE: Predict Diabetes
  • 43. KNN - Predict diabetes Objective: Predict whether a person will be diagnosed with diabetes or not We have a dataset of 768 people who were or were not diagnosed with diabetes
  • 44. KNN - Predict diabetes Import the required Scikit-learn libraries as shown:
  • 45. KNN - Predict diabetes Load the dataset and have a look:
  • 46. KNN - Predict diabetes Values of columns like ‘Glucose’, BloodPressure’ cannot be accepted as zeroes because it will affect the outcome We can replace such values with the mean of the respective column:
  • 47. KNN - Predict diabetes Before proceeding further, let’s split the dataset into train and test:
  • 48. KNN - Predict diabetes Feature Scaling: Rule of thumb: Any algorithm that computes distance or assumes normality, scale your features!
  • 49. KNN - Predict diabetes Then define the model using KNeighborsClassifier and fit the train data in the model N_neighbors here is ‘K’ p is the power parameter to define the metric used, which is ‘Euclidean’ in our case
  • 50. KNN - Predict diabetes There are other metrics also to evaluate the distance like Manhattan distance , Minkowski distance etc
  • 51. KNN - Predict diabetes Let’s predict the test results:
  • 52. KNN - Predict diabetes It’s important to evaluate the model, let’s use confusion matrix to do that:
  • 53. KNN - Predict diabetes Calculate accuracy of the model:
  • 54. KNN - Predict diabetes So, we have created a model using KNN which can predict whether a person will have diabetes or not
  • 55. KNN - Predict diabetes And accuracy of 80% tells us that it is a pretty fair fit in the model!
  • 56. Summary Why we need knn? Eucledian distance Choosing the value of k Knn classifier for diabetes predictionHow KNN works?

Editor's Notes

  • #3: Remove title case
  • #4: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #5: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #6: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #7: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #8: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #9: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #10: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #11: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #12: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #13: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #15: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #16: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #17: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #18: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #19: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #20: ,. Unlike other regression algorithms where we have one or more than one dependent variables
  • #29: ,. Unlike other regression algorithms where we have one or more than one dependent variables We have a small data set as KNN is a lazy learner so it becomes slow with large datasets
  • #30: ,. Unlike other regression algorithms where we have one or more than one dependent variables We have a small data set as KNN is a lazy learner so it becomes slow with large datasets
  • #31: ,. Unlike other regression algorithms where we have one or more than one dependent variables We have a small data set as KNN is a lazy learner so it becomes slow with large datasets
  • #49:  Most of the times, your dataset will contain features highly varying in magnitudes, units and range. we need to bring all features to the same level of magnitudes. This can be acheived by scaling
  • #53: The F1 score is the harmonic average of the precision and recall, where an F1 score reaches its best value at 1 (perfect precision and recall) and worst at 0.