Aprendizagem baseada em instâncias (K vizinhos mais próximos)

Slides:



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

Machine Learning Instance Based Learning & Case Based Reasoning Exercise Solutions.
Data Mining Classification: Alternative Techniques
Preventing Overfitting Problem: We don’t want to these algorithms to fit to ``noise’’ The generated tree may overfit the training data –Too many branches,
Instance Based Learning
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
Statistical Classification Rong Jin. Classification Problems X Input Y Output ? Given input X={x 1, x 2, …, x m } Predict the class label y  Y Y = {-1,1},
1er. Escuela Red ProTIC - Tandil, de Abril, Instance-Based Learning 4.1 Introduction Instance-Based Learning: Local approximation to the.
Classification and Decision Boundaries
Navneet Goyal. Instance Based Learning  Rote Classifier  K- nearest neighbors (K-NN)  Case Based Resoning (CBR)
Instance Based Learning
Università di Milano-Bicocca Laurea Magistrale in Informatica Corso di APPRENDIMENTO E APPROSSIMAZIONE Lezione 8 - Instance based learning Prof. Giancarlo.
K nearest neighbor and Rocchio algorithm
Bayesian classifiers.
Instance based learning K-Nearest Neighbor Locally weighted regression Radial basis functions.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Nearest Neighbor Models (Reading: Chapter.
Instance Based Learning
Instance-Based Learning
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.
CES 514 – Data Mining Lec 9 April 14 Mid-term k nearest neighbor.
KNN, LVQ, SOM. Instance Based Learning K-Nearest Neighbor Algorithm (LVQ) Learning Vector Quantization (SOM) Self Organizing Maps.
Instance Based Learning Bob Durrant School of Computer Science University of Birmingham (Slides: Dr Ata Kabán) 1.
INSTANCE-BASE LEARNING
CS Instance Based Learning1 Instance Based Learning.
K Nearest Neighborhood (KNNs)
DATA MINING LECTURE 10 Classification k-nearest neighbor classifier Naïve Bayes Logistic Regression Support Vector Machines.
COMMON EVALUATION FINAL PROJECT Vira Oleksyuk ECE 8110: Introduction to machine Learning and Pattern Recognition.
1 Data Mining Lecture 5: KNN and Bayes Classifiers.
Basic Data Mining Technique
Chapter 8 The k-Means Algorithm and Genetic Algorithm.
11/12/2012ISC471 / HCI571 Isabelle Bichindaritz 1 Prediction.
 2003, G.Tecuci, Learning Agents Laboratory 1 Learning Agents Laboratory Computer Science Department George Mason University Prof. Gheorghe Tecuci 9 Instance-Based.
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Statistical Inference (By Michael Jordon) l Bayesian perspective –conditional perspective—inferences.
1 Instance Based Learning Ata Kaban The University of Birmingham.
CpSc 881: Machine Learning Instance Based Learning.
CpSc 810: Machine Learning Instance Based Learning.
Outline K-Nearest Neighbor algorithm Fuzzy Set theory Classifier Accuracy Measures.
Lazy Learners K-Nearest Neighbor algorithm Fuzzy Set theory Classifier Accuracy Measures.
Kansas State University Department of Computing and Information Sciences CIS 798: Intelligent Systems and Machine Learning Tuesday, November 23, 1999.
KNN Classifier.  Handed an instance you wish to classify  Look around the nearby region to see what other classes are around  Whichever is most common—make.
DATA MINING LECTURE 10b Classification k-nearest neighbor classifier
Meta-learning for Algorithm Recommendation Meta-learning for Algorithm Recommendation Background on Local Learning Background on Algorithm Assessment Algorithm.
CS Machine Learning Instance Based Learning (Adapted from various sources)
K-Nearest Neighbor Learning.
1 Learning Bias & Clustering Louis Oliphant CS based on slides by Burr H. Settles.
Eick: kNN kNN: A Non-parametric Classification and Prediction Technique Goals of this set of transparencies: 1.Introduce kNN---a popular non-parameric.
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.
CS 8751 ML & KDDInstance Based Learning1 k-Nearest Neighbor Locally weighted regression Radial basis functions Case-based reasoning Lazy and eager learning.
1 Instance Based Learning Soongsil University Intelligent Systems Lab.
Classification Nearest Neighbor
Data Mining: Concepts and Techniques (3rd ed
Instance Based Learning (Adapted from various sources)
K Nearest Neighbor Classification
Classification Nearest Neighbor
Nearest-Neighbor Classifiers
یادگیری بر پایه نمونه Instance Based Learning Instructor : Saeed Shiry
Instance Based Learning
COSC 4335: Other Classification Techniques
Nearest Neighbor Classifiers
Chap 8. Instance Based Learning
Machine Learning: UNIT-4 CHAPTER-1
Nearest Neighbors CSC 576: Data Mining.
Data Mining Classification: Alternative Techniques
Nearest Neighbor Classifiers
CSE4334/5334 Data Mining Lecture 7: Classification (4)
Presentation transcript:

Aprendizagem baseada em instâncias (K vizinhos mais próximos)

SAD Tagus 2004/05 H. Galhardas The k-Nearest Neighbor Algorithm (1) All instances correspond to points in the n-D space. All instances correspond to points in the n-D space. Given an unknown tuple, the k-NN classifier searches the pattern space for the k training tuples that are closest to the unknown tuple. Given an unknown tuple, the k-NN classifier searches the pattern space for the k training tuples that are closest to the unknown tuple. The nearest neighbor is defined in terms of Euclidean distance: The nearest neighbor is defined in terms of Euclidean distance: The target function could be discrete- or real- valued. The target function could be discrete- or real- valued. For discrete-valued, the k-NN returns the most common value among the k training examples nearest to x q. For discrete-valued, the k-NN returns the most common value among the k training examples nearest to x q.

SAD Tagus 2004/05 H. Galhardas The k-Nearest Neighbor Algorithm (2) Key idea: just store all training examples Key idea: just store all training examples Nearest neighbor: Given query instance x q, first locate nearest training example x n, then estimate f(x q )=f(x n ) Given query instance x q, first locate nearest training example x n, then estimate f(x q )=f(x n ) K-nearest neighbor: Given x q, take vote among its k nearest neighbors (if discrete-valued target function) Given x q, take vote among its k nearest neighbors (if discrete-valued target function) Take mean of f values of k nearest neighbors (if real-valued) f(x q )=  i=1 k f(x i )/k Take mean of f values of k nearest neighbors (if real-valued) f(x q )=  i=1 k f(x i )/k

SAD Tagus 2004/05 H. Galhardas Lazy vs Eager Learning lazy evaluation Instance-based learning: lazy evaluation eager evaluation Decision-tree and Bayesian classification: eager evaluation Key differences Lazy: may consider query instance xq when deciding how to generalize beyond the training data D Eager: cannot since they have already chosen global approximation when seeing the query Efficiency: Lazy - less time training but more time predicting Efficiency: Lazy - less time training but more time predicting Accuracy Accuracy Lazy: effectively uses a richer hypothesis space since it uses many local linear functions to form its implicit global approximation to the target function Eager: must commit to a single hypothesis that covers the entire instance space

SAD Tagus 2004/05 H. Galhardas When to Consider Nearest Neighbors Instances map to points in R N Instances map to points in R N Less than 20 attributes per instance, typically normalized Less than 20 attributes per instance, typically normalized Lots of training data Lots of training data Advantages: Training is very fast Training is very fast Learn complex target functions Learn complex target functions Do not loose information Do not loose information Disadvantages: Slow at query time Slow at query time Presorting and indexing training samples into search trees reduces time Easily fooled by irrelevant attributes Easily fooled by irrelevant attributes

SAD Tagus 2004/05 H. Galhardas How to determine the good value for K? Determined experimentally Determined experimentally Start with K=1 and use a test set to validate the error rate of the classifier Start with K=1 and use a test set to validate the error rate of the classifier Repeat with K=K+1 Repeat with K=K+1 Choose the value of K for which the error rate is minimum Choose the value of K for which the error rate is minimum

SAD Tagus 2004/05 H. Galhardas Definition of Voronoi diagram the decision surface induced by 1-NN for a typical set of training examples. the decision surface induced by 1-NN for a typical set of training examples.. _ + _ xqxq + _ _ + _ _

SAD Tagus 2004/05 H. Galhardas 1-Nearest Neighbor query point q f nearest neighbor q i

SAD Tagus 2004/05 H. Galhardas 3-Nearest Neighbors query point q f 3 nearest neighbors 2x,1o

SAD Tagus 2004/05 H. Galhardas 7-Nearest Neighbors query point q f 7 nearest neighbors 3x,4o

SAD Tagus 2004/05 H. Galhardas Distance Weighted k-NN Give more weight to neighbors closer to the query point f ^ (x q ) =  i=1 k w i f(x i ) /  i=1 k w i where w i =K(d(x q,x i )) and d(x q,x i ) is the distance between x q and x i

SAD Tagus 2004/05 H. Galhardas Curse of Dimensionality Imagine instances described by 20 attributes but only 3 are relevant to target function Curse of dimensionality: nearest neighbor is easily misled when instance space is high-dimensional One approach: Stretch j-th axis by weight z j, where z 1,…,z n chosen to minimize prediction error Stretch j-th axis by weight z j, where z 1,…,z n chosen to minimize prediction error Use cross-validation to automatically choose weights z 1,…,z n Use cross-validation to automatically choose weights z 1,…,z n Note setting z j to zero eliminates this dimension alltogether (feature subset selection) Note setting z j to zero eliminates this dimension alltogether (feature subset selection)

SAD Tagus 2004/05 H. Galhardas Bibliografia Data Mining: Concepts and Techniques, J. Han & M. Kamber, Morgan Kaufmann, 2001 (Sect ) Data Mining: Concepts and Techniques, J. Han & M. Kamber, Morgan Kaufmann, 2001 (Sect ) Machine Learning, Tom Mitchell, McGraw 1997 (Cap 8) Machine Learning, Tom Mitchell, McGraw 1997 (Cap 8)