Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
21 views
6 pages
Rad Assignment (KNN)
Knn
Uploaded by
tarunsanka15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Rad Assignment (KNN) For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
21 views
6 pages
Rad Assignment (KNN)
Knn
Uploaded by
tarunsanka15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Rad Assignment (KNN) For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Rad Assignment (KNN) For Later
You are on page 1
/ 6
Search
Fullscreen
KNN Algorithm - Finding Nearest Neighbours Introduction K-Nearest Neighbour is one of the simplest Machine Learning algorithms based on Supervised Learning technique. K.NN algorithm assumes the similarity between the new case/data and available eases and put the new case into the category that is most similar to the available categories, K-NN algorithm stores all the available data and classifies a new data point based on the similarity. This means when new data appears then it can be classified into a well suite category by using K- NN algorithm. K-NN algorithm can be used for Regression as well as for Classification but mostly it is used for the Classification problems. + Lazy learning algorithm — KNN is a lazy learning algorithm because it does nothave a specialized training phase and uses all the data for training while classification + Non-parametric learning algorithm - KNN is also a non-parametric learning algorithm because it doesn’t assume anything about the underlying data. Why do we need a K-NN Algorithm? Suppose there are two categories, i.e., Category A and Categary B, and we have a ‘new data paint x1, so this data paint will Lie in which of these categaries. Te solve this type of problem, we need a K-NN algorithm. With the help of K-NN, we can easily identify the category ar class of a particular dataset. Consider the below diagram: Scanned with CamScannerWorking of KNN Algorithm K-nearest neighbors (KNN) algorithm uses ‘feature similarity’ to predict the values of new datapoints which further means that the new data point will be assigned a value based on how closely it matches the points in the training set. We can understand its working with the help of following steps ~ Step 1 - For implementing any algorithm, we need dataset. So during the first step of KINN, we must load the training as well as test data. Step 2 - Next, we need to choose the value of be any integer. the nearest data points. K can Step 3 - For each point in the test data do the following ~ + 2.1 ~ Calculate the distance between test data and each row of training data with the help of any of the method namely: Euclidean, Manhattan or Hamming distance. The mast commonly used method to calculate distance is Euclidean, + 3.2 -Now, based on the distance value, sart them in ascending order. + 3.3—Next, it will choose the top K rows fromthe sorted array. + 34 - Now, it will assign a class to the test paint based on most frequent class of these rows Step 4~ End As we know K-nearest neighbors (KNN) algorithm can be used for both classificationas well as regression. The follawing are the recipes in Python ta use. Scanned with CamScannerKWNN as classifier as well as regressor — Scanned with CamScannerKUN as Regressor ‘Scanned with CamScannerPros and Cons of KNN Pros + itis very simple algorithen 10 understand and interpret + Itis very useful for nonlinear data because there is no assumption about data in this algarithin, + itis a versatile algorithm as we can use it for classification as well as regression + It has relatively high accuracy but there are much better supervised learning models than KNN ‘Cons + itis computationally a bit expensive algorithm because it stores all the training data. + High memory storage required as compared to other supervised teaming algorithms = Prediction is slow in case ot big N. + ILS Very Sensitive to the Seale of data as well as irrelevant features. Applications of KNN The following are some of the areas in which KNN can be applied succes fully ~ © Banking System KNN can be used in banking system to predict weather an individual is fil for loan ‘approval? Does thal individual have the charactenstics similar to the defauiters one? * Calculating Credit Ratings KNN algorithms can be used fo find an individual's credit rating by comparing with the persons having similar traits. * Politics With the help ef KNN algorithms. we can classify a potential voter into various classes ke “Viill Vole", “Vuill nat Vote", “Will Vole to Party ‘Congress’, “Will Vole to Party ‘BJP’. Other areas in which KNN algorithm can be used are Spaech Recagnition, Handwriting Detection, Image Recognition and Video Recognition Scanned with CamScannerScanned with CamScanner
You might also like
K-Nearest Neighbor (KNN) Algorithm For Machine Learning
PDF
No ratings yet
K-Nearest Neighbor (KNN) Algorithm For Machine Learning
17 pages
K-Nearest Neighbor (KNN) Algorithm For Machine Learning - Javatpoint
PDF
No ratings yet
K-Nearest Neighbor (KNN) Algorithm For Machine Learning - Javatpoint
18 pages
K-Nearest Neighbor Algorithm
PDF
100% (1)
K-Nearest Neighbor Algorithm
6 pages
Updated K-Nearest Neighbors in Machine Learning
PDF
No ratings yet
Updated K-Nearest Neighbors in Machine Learning
11 pages
K Nearest Neighbour
PDF
100% (1)
K Nearest Neighbour
35 pages
ML Unit 5..
PDF
No ratings yet
ML Unit 5..
40 pages
KNN - Feb 19
PDF
No ratings yet
KNN - Feb 19
42 pages
K-Nearest Neighbors: KNN Algorithm Pseudocode
PDF
No ratings yet
K-Nearest Neighbors: KNN Algorithm Pseudocode
2 pages
Why Do We Need A K-NN Algorithm?
PDF
No ratings yet
Why Do We Need A K-NN Algorithm?
11 pages
AI Unit 5 Part1
PDF
No ratings yet
AI Unit 5 Part1
6 pages
Enhancing K-Nearest Neighbor Algorithm: A Comprehensive Review and Performance Analysis of Modifications
PDF
No ratings yet
Enhancing K-Nearest Neighbor Algorithm: A Comprehensive Review and Performance Analysis of Modifications
55 pages
Presentation of KNN-1
PDF
No ratings yet
Presentation of KNN-1
18 pages
K-Nearest Neighbors
PDF
No ratings yet
K-Nearest Neighbors
35 pages
CSL0777 L22
PDF
No ratings yet
CSL0777 L22
35 pages
KNN Algorithm
PDF
No ratings yet
KNN Algorithm
4 pages
K-Nearest NEIGHBOUR
PDF
No ratings yet
K-Nearest NEIGHBOUR
16 pages
K-Nearest Neighbor Classification-Algorithm and Characteristics
PDF
No ratings yet
K-Nearest Neighbor Classification-Algorithm and Characteristics
6 pages
Aitee (Notes) KNN
PDF
No ratings yet
Aitee (Notes) KNN
3 pages
ML Unit-2
PDF
No ratings yet
ML Unit-2
24 pages
Machine Learning KNN - Supervised
PDF
No ratings yet
Machine Learning KNN - Supervised
9 pages
Shubh
PDF
No ratings yet
Shubh
10 pages
ML-Unit 5
PDF
No ratings yet
ML-Unit 5
40 pages
K-Nearest Neighbors (KNN)
PDF
No ratings yet
K-Nearest Neighbors (KNN)
3 pages
K-Nearest Neighbour's Algorithm
PDF
No ratings yet
K-Nearest Neighbour's Algorithm
5 pages
K - Nearest Neighbor
PDF
No ratings yet
K - Nearest Neighbor
2 pages
K-Nearest Neighbor (KNN) 6
PDF
No ratings yet
K-Nearest Neighbor (KNN) 6
46 pages
21 KNN
PDF
No ratings yet
21 KNN
28 pages
KNN
PDF
No ratings yet
KNN
9 pages
'Machine Learning (Nagarjun)
PDF
No ratings yet
'Machine Learning (Nagarjun)
10 pages
Machine Learning Unit-3.1
PDF
No ratings yet
Machine Learning Unit-3.1
20 pages
Amrendra
PDF
No ratings yet
Amrendra
9 pages
K-Nearest Neighbor (KNN) Algorithm For Machine Learning: Non-Parametric Algorithm Lazy Learner Algorithm
PDF
No ratings yet
K-Nearest Neighbor (KNN) Algorithm For Machine Learning: Non-Parametric Algorithm Lazy Learner Algorithm
5 pages
Intro To KNN
PDF
No ratings yet
Intro To KNN
8 pages
Lecture 38 KNN
PDF
No ratings yet
Lecture 38 KNN
4 pages
1694600817-Unit2.3 KNN CU 2.0
PDF
No ratings yet
1694600817-Unit2.3 KNN CU 2.0
25 pages
Lecture 14 and 15
PDF
No ratings yet
Lecture 14 and 15
42 pages
02-knn Notes
PDF
No ratings yet
02-knn Notes
23 pages
K-Nearest Neighbor (KNN)
PDF
No ratings yet
K-Nearest Neighbor (KNN)
12 pages
14 K - Nearest Neighbours
PDF
No ratings yet
14 K - Nearest Neighbours
8 pages
Seminar Report File On KNN Models: University Institute of Engineering and Technology, Kurukshetra University
PDF
No ratings yet
Seminar Report File On KNN Models: University Institute of Engineering and Technology, Kurukshetra University
24 pages
K-Nearest Neighbors: Marcel Van Velzen Junior Marte Garcia
PDF
No ratings yet
K-Nearest Neighbors: Marcel Van Velzen Junior Marte Garcia
8 pages
K Nearest Neighbor (KNN)
PDF
No ratings yet
K Nearest Neighbor (KNN)
9 pages
K-Nearest Neighbor (KNN) Algorithm For Machine Learning
PDF
No ratings yet
K-Nearest Neighbor (KNN) Algorithm For Machine Learning
3 pages
K-Nearest Neighbors (KNN) Algorithm in Machine Learning
PDF
No ratings yet
K-Nearest Neighbors (KNN) Algorithm in Machine Learning
3 pages
Day43 KNN Intro
PDF
No ratings yet
Day43 KNN Intro
4 pages
K-Nearest Neighbor Algorithm
PDF
No ratings yet
K-Nearest Neighbor Algorithm
6 pages
K Nearest Neighbors
PDF
No ratings yet
K Nearest Neighbors
22 pages
Untitled 9
PDF
No ratings yet
Untitled 9
17 pages
K-NN Algorithm and Clustering Analysis
PDF
No ratings yet
K-NN Algorithm and Clustering Analysis
93 pages
Machine Learning
PDF
No ratings yet
Machine Learning
32 pages
Bài nhóm tìm hiểu về KNN
PDF
No ratings yet
Bài nhóm tìm hiểu về KNN
5 pages
Unit V Non Parametric Machine Learning
PDF
No ratings yet
Unit V Non Parametric Machine Learning
47 pages
K-Nearest Neighbor
PDF
No ratings yet
K-Nearest Neighbor
22 pages
K - Nearest Neighbor
PDF
No ratings yet
K - Nearest Neighbor
13 pages
K-Nearest Neighbor (KNN) : Non-Parametric Algorithm
PDF
No ratings yet
K-Nearest Neighbor (KNN) : Non-Parametric Algorithm
7 pages
Unit 3 KNN
PDF
No ratings yet
Unit 3 KNN
16 pages
Miss Erum Mahood Topic: KNN Algorthim: Presentator BY: Zobia Malaika Maryam Minahil
PDF
No ratings yet
Miss Erum Mahood Topic: KNN Algorthim: Presentator BY: Zobia Malaika Maryam Minahil
10 pages
Instance Based Learning
PDF
No ratings yet
Instance Based Learning
7 pages
6 - KNN Classifier
PDF
No ratings yet
6 - KNN Classifier
10 pages