Jyoti Nigania

Hi,i am writing blogs for our platform House of Bots on Artificial Intelligence, Machine Learning, Chatbots, Automation etc after completing my MBA degree. ...

Full Bio 

Hi,i am writing blogs for our platform House of Bots on Artificial Intelligence, Machine Learning, Chatbots, Automation etc after completing my MBA degree.

A Strong Determination Of Machine Learning In 2K19
11 days ago

Data Science: A Team Spirit
18 days ago

If You Are A Beginner Then Have Handy These Machine Learning Books To Gain Knowledge
19 days ago

Industry Automation Is Gearing Up Various Companies
21 days ago

Perks Of Becoming A Big Data Engineer Highlighted In A YouTube Video
27 days ago

These Computer Science Certifications Really Pay Good To You

List Of Top 5 Programming Skills Which Makes The Programmer Different From Others?

Which Programming Language Should We Use On A Regular Basis?

Cloud Engineers Are In Demand And What Programming Language They Should Learn?

Python Opens The Door For Computer Programming

What is KNN Algorithms? Understand with the help of Examples

By Jyoti Nigania |Email | Jun 29, 2018 | 11895 Views

By now, we all know Machine Learning models makes predictions by learning from the past data available. So here we have input value, a machine learning model based on those inputs understands and gives out the predicted output.

For example, two persons walking and one of them said is it that a dog, but that is the black cat passing across the path and another person said no dear, you can differentiate between a cat and a dog based on their characteristics. Cat has sharp claws, uses to climb, smaller length of ears, meows and purrs and doesn't love to play around while dog has dull claws, bigger length of ears, barks and loves to run around. 

So based on these characteristics one can easily identify whether it is a dog or a cat. As KNN is based on feature similarity, we can do classification using KNN classifier! Fore more insights watch video:
What is KNN?
KNN-K nearest neighbors is one of the simplest supervised machine learning algorithms mostly used for classification as it classifies a data point based on how its neighbors are classified. KNN stores all the available cases and classifies new cases based on a similarity measure. K in KNN is a parameter that refers to the number of nearest neighbors to include in the majority voting process. A data point is classified by majority votes from its nearest neighbors. 
How do we choose 'K' and when we use KNN Algorithms?
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. 
Where n is the total number of data points and odd value of K is selected to avoid confusion between the two classes of data. 

We can use KNN algorithm when:
  • Data is labeled
  • Data is noise free
  • Dataset is small

Thus, KNN algorithm is one of the simplest classification algorithms. Even with such simplicity, it can give highly competitive results. KNN algorithm can also be used for regression problems. The only difference from the discussed methodology will be using averages of nearest neighbors rather than voting from nearest neighbors. KNN can be coded in a single line on R. 

Source: HOB