Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Unsupervised Learning with Python

You're reading from  Hands-On Unsupervised Learning with Python

Product type Book
Published in Feb 2019
Publisher Packt
ISBN-13 9781789348279
Pages 386 pages
Edition 1st Edition
Languages
Author (1):
Giuseppe Bonaccorso Giuseppe Bonaccorso
Profile icon Giuseppe Bonaccorso
Toc

Table of Contents (12) Chapters close

Preface 1. Getting Started with Unsupervised Learning 2. Clustering Fundamentals 3. Advanced Clustering 4. Hierarchical Clustering in Action 5. Soft Clustering and Gaussian Mixture Models 6. Anomaly Detection 7. Dimensionality Reduction and Component Analysis 8. Unsupervised Neural Network Models 9. Generative Adversarial Networks and SOMs 10. Assessments 11. Other Books You May Enjoy

K-Nearest Neighbors

K-Nearest Neighbors (KNN) is a method belonging to a category called instance-based learning. In this case, there's no parametrized model, but rather a rearrangement of the samples in order to speed up specific queries. In the simplest case (also known as brute-force search), let's say we have a dataset X containing M samples xi ∈ ℜN. Given a distance function d(xi, xj), it's possible to define the radius neighborhood of a test sample xi as:

The set ν(xi) is a ball centered on xi and including all the samples whose distance is less or equal to R. Alternatively, it's possible to compute only the top k nearest neighbors, which are the k samples closer to xi (in general, this set is a subset of ν(xi), but the opposite condition can also happen when k is very large). The procedure is straightforward but, unfortunately...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime