Skip to Main Content
Hands-On Ensemble Learning with R
book

Hands-On Ensemble Learning with R

by Prabhanjan Narayanachar Tattar
July 2018
Beginner to intermediate content levelBeginner to intermediate
376 pages
9h 1m
English
Packt Publishing
Content preview from Hands-On Ensemble Learning with R

k-NN classifier

In Chapter 1, Introduction to Ensemble Techniques, we became familiar with a variety of classification models. Some readers might already be familiar with the k-NN model. The k-NN classifier is one of the most simple, intuitive, and non-assumptive models. The name of the model itself suggests how it might be working - nearest neighborhoods! And that's preceded by k! Thus, if we have N points in a study, we find the k-nearest points in neighborhood, and then make a note of the class of the k-neighbors. The majority class of the k-neighbors is then assigned to the unit. In case of regression, the average of the neighbors is assigned to the unit. The following is a visual depiction of k-NN:

Figure 4: Visual depiction of k-NN

The top ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Deep Learning with R

Hands-On Deep Learning with R

Rodger Devine, Michael Pawlus
Learning Bayesian Models with R

Learning Bayesian Models with R

Hari Manassery Koduvely
Advanced Machine Learning with R

Advanced Machine Learning with R

Cory Lesmeister, Dr. Sunil Kumar Chinnamgari

Publisher Resources

ISBN: 9781788624145Supplemental Content