Lecture 6 K-Nearest Neighbor Classifier

Slides:



Advertisements
Similar presentations
1 Classification using instance-based learning. 3 March, 2000Advanced Knowledge Management2 Introduction (lazy vs. eager learning) Notion of similarity.
Advertisements

G53MLE | Machine Learning | Dr Guoping Qiu
Data Mining Classification: Alternative Techniques
Data Mining Classification: Alternative Techniques
Lecture 5 Bayesian Learning
INTRODUCTION TO Machine Learning 3rd Edition
Machine Learning Lecture 4 Multilayer Perceptrons G53MLE | Machine Learning | Dr Guoping Qiu1.
Indian Statistical Institute Kolkata
1 Machine Learning: Lecture 7 Instance-Based Learning (IBL) (Based on Chapter 8 of Mitchell T.., Machine Learning, 1997)
Lazy vs. Eager Learning Lazy vs. eager learning
Classification and Decision Boundaries
Navneet Goyal. Instance Based Learning  Rote Classifier  K- nearest neighbors (K-NN)  Case Based Resoning (CBR)
Instance Based Learning
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
K nearest neighbor and Rocchio algorithm
MACHINE LEARNING 9. Nonparametric Methods. Introduction Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 2 
CS292 Computational Vision and Language Pattern Recognition and Classification.
Instance based learning K-Nearest Neighbor Locally weighted regression Radial basis functions.
By Fernando Seoane, April 25 th, 2006 Demo for Non-Parametric Classification Euclidean Metric Classifier with Data Clustering.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Nearest Neighbor Models (Reading: Chapter.
Instance Based Learning. Nearest Neighbor Remember all your data When someone asks a question –Find the nearest old data point –Return the answer associated.
Principle of Locality for Statistical Shape Analysis Paul Yushkevich.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
These slides are based on Tom Mitchell’s book “Machine Learning” Lazy learning vs. eager learning Processing is delayed until a new instance must be classified.
1 Nearest Neighbor Learning Greg Grudic (Notes borrowed from Thomas G. Dietterich and Tom Mitchell) Intro AI.
Aprendizagem baseada em instâncias (K vizinhos mais próximos)
KNN, LVQ, SOM. Instance Based Learning K-Nearest Neighbor Algorithm (LVQ) Learning Vector Quantization (SOM) Self Organizing Maps.
Nearest Neighbour Condensing and Editing David Claus February 27, 2004 Computer Vision Reading Group Oxford.
INTRODUCTION TO Machine Learning ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
INSTANCE-BASE LEARNING
Machine Learning Lecture 10 Decision Trees G53MLE Machine Learning Dr Guoping Qiu1.
Data Mining Joyeeta Dutta-Moscato July 10, Wherever we have large amounts of data, we have the need for building systems capable of learning information.
Chapter 4 CONCEPTS OF LEARNING, CLASSIFICATION AND REGRESSION Cios / Pedrycz / Swiniarski / Kurgan.
COMMON EVALUATION FINAL PROJECT Vira Oleksyuk ECE 8110: Introduction to machine Learning and Pattern Recognition.
Machine Learning Lecture 11 Summary G53MLE | Machine Learning | Dr Guoping Qiu1.
K Nearest Neighbors Saed Sayad 1www.ismartsoft.com.
1 Business Intelligence Technologies – Data Mining Lecture 5 Personalization, k-Nearest Neighbors.
The Broad Institute of MIT and Harvard Classification / Prediction.
K Nearest Neighbors Classifier & Decision Trees
Overview of Supervised Learning Overview of Supervised Learning2 Outline Linear Regression and Nearest Neighbors method Statistical Decision.
MA4102 – Data Mining and Neural Networks Nathan Ifill University of Leicester Image source: Antti Ajanki, “Example of k-nearest neighbor.
 2003, G.Tecuci, Learning Agents Laboratory 1 Learning Agents Laboratory Computer Science Department George Mason University Prof. Gheorghe Tecuci 9 Instance-Based.
Learning from observations
NEAREST NEIGHBORS ALGORITHM Lecturer: Yishay Mansour Presentation: Adi Haviv and Guy Lev 1.
Linear Discrimination Reading: Chapter 2 of textbook.
Lecture 27: Recognition Basics CS4670/5670: Computer Vision Kavita Bala Slides from Andrej Karpathy and Fei-Fei Li
ECE 5984: Introduction to Machine Learning Dhruv Batra Virginia Tech Topics: –(Finish) Nearest Neighbour Readings: Barber 14 (kNN)
A NOVEL METHOD FOR COLOR FACE RECOGNITION USING KNN CLASSIFIER
1 CSCI 3202: Introduction to AI Decision Trees Greg Grudic (Notes borrowed from Thomas G. Dietterich and Tom Mitchell) Intro AIDecision Trees.
KNN & Naïve Bayes Hongning Wang Today’s lecture Instance-based classifiers – k nearest neighbors – Non-parametric learning algorithm Model-based.
Realtime Recognition of Orchestral Instruments Ichiro Fujinaga McGill University.
Outline K-Nearest Neighbor algorithm Fuzzy Set theory Classifier Accuracy Measures.
Lazy Learners K-Nearest Neighbor algorithm Fuzzy Set theory Classifier Accuracy Measures.
K nearest neighbors algorithm Parallelization on Cuda PROF. VELJKO MILUTINOVIĆ MAŠA KNEŽEVIĆ 3037/2015.
Musical Genre Categorization Using Support Vector Machines Shu Wang.
K-Nearest Neighbor Learning.
Mete Ozay, Fatos T. Yarman Vural —Presented by Tianxiao Jiang
Debrup Chakraborty Non Parametric Methods Pattern Recognition and Machine Learning.
Kansas State University Department of Computing and Information Sciences CIS 890: Special Topics in Intelligent Systems Wednesday, November 15, 2000 Cecil.
Instance-Based Learning Evgueni Smirnov. Overview Instance-Based Learning Comparison of Eager and Instance-Based Learning Instance Distances for Instance-Based.
SUPERVISED AND UNSUPERVISED LEARNING Presentation by Ege Saygıner CENG 784.
KNN & Naïve Bayes Hongning Wang
Lecture 7 Spring 2010 Dr. Jianjun Hu CSCE883 Machine Learning.
Automatic Classification of Audio Data by Carlos H. L. Costa, Jaime D. Valle, Ro L. Koerich IEEE International Conference on Systems, Man, and Cybernetics.
ECE 5424: Introduction to Machine Learning
Machine Learning Week 1.
Instance Based Learning
Lecture 16. Classification (II): Practical Considerations
ECE – Pattern Recognition Lecture 10 – Nonparametric Density Estimation – k-nearest-neighbor (kNN) Hairong Qi, Gonzalez Family Professor Electrical.
Presentation transcript:

Lecture 6 K-Nearest Neighbor Classifier Machine Learning Lecture 6 K-Nearest Neighbor Classifier G53MLE Machine Learning Dr Guoping Qiu

Objects, Feature Vectors, Points x1 x2 Elliptical blobs (objects) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 X(15) X(1) X(7) X(16) X(3) X(8) X(25) X(12) X(13) X(6) X(9) X(10) X(4) X(11) X(14)

G53MLE Machine Learning Dr Guoping Qiu Nearest Neighbours x1 x2 X(j)=(x1(j), x2(j), …,xn(j)) X(i)=(x1(i), x2(i), …,xn(i)) G53MLE Machine Learning Dr Guoping Qiu

Nearest Neighbour Algorithm Given training data (X(1),D(1)), (X(2),D(2)), …, (X(N),D(N)) Define a distance metric between points in inputs space. Common measures are: Euclidean Distance G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Given test point X Find the K nearest training inputs to X Denote these points as (X(1),D(1)), (X(2), D(2)), …, (X(k), D(k)) x G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Classification The class identification of X Y = most common class in set {D(1), D(2), …, D(k)} x x G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Example : Classify whether a customer will respond to a survey question using a 3-Nearest Neighbor classifier Customer Age Income No. credit cards Response John 35 35K 3 No Rachel 22 50K 2 Yes Hannah 63 200K 1 Tom 59 170K Nellie 25 40K 4 David 37 ? G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Example : 3-Nearest Neighbors 15.16 15 152.23 122 15.74 G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Example : 3-Nearest Neighbors 15.16 15 152.23 122 15.74 Three nearest ones to David are: No, Yes, Yes G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Example : 3-Nearest Neighbors 15.16 15 152.23 122 Yes 15.74 Three nearest ones to David are: No, Yes, Yes G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Picking K Use N fold cross validation – Pick K to minimize the cross validation error For each of N training example Find its K nearest neighbours Make a classification based on these K neighbours Calculate classification error Output average error over all examples Use the K that gives lowest average error over the N training examples G53MLE Machine Learning Dr Guoping Qiu

K-Nearest Neighbour Model Example: For the example we saw earlier, pick the best K from the set {1, 2, 3} to build a K-NN classifier G53MLE Machine Learning Dr Guoping Qiu

G53MLE Machine Learning Dr Guoping Qiu Further Readings T. M. Mitchell, Machine Learning, McGraw-Hill International Edition, 1997 Chapter 8 G53MLE Machine Learning Dr Guoping Qiu

Tutorial/Exercise Questions K nearest neighbor classifier has to store all training data creating high requirement on storage. Can you think of ways to reduce the storage requirement without affecting the performance? (hint: search the Internet, you will find many approximation methods). G53MLE Machine Learning Dr Guoping Qiu