1 Instance Based Learning Ata Kaban The University of Birmingham.

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
K-means method for Signal Compression: Vector Quantization
1 CS 391L: Machine Learning: Instance Based Learning Raymond J. Mooney University of Texas at Austin.
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
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
MACHINE LEARNING 9. Nonparametric Methods. Introduction Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 2 
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
Lazy Learning k-Nearest Neighbour Motivation: availability of large amounts of processing power improves our ability to tune k-NN classifiers.
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.
CES 514 – Data Mining Lec 9 April 14 Mid-term k nearest neighbor.
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.
Instance Based Learning Bob Durrant School of Computer Science University of Birmingham (Slides: Dr Ata Kabán) 1.
INSTANCE-BASE LEARNING
Memory-Based Learning Instance-Based Learning K-Nearest Neighbor.
CS Instance Based Learning1 Instance Based Learning.
Module 04: Algorithms Topic 07: Instance-Based Learning
K Nearest Neighborhood (KNNs)
DATA MINING LECTURE 10 Classification k-nearest neighbor classifier Naïve Bayes Logistic Regression Support Vector Machines.
1 Data Mining Lecture 5: KNN and Bayes Classifiers.
K Nearest Neighbors Saed Sayad 1www.ismartsoft.com.
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.
Instance Based Learning
CpSc 881: Machine Learning Instance Based Learning.
CpSc 810: Machine Learning Instance Based Learning.
COMP 2208 Dr. Long Tran-Thanh University of Southampton K-Nearest Neighbour.
Chapter1: Introduction Chapter2: Overview of Supervised 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
Kansas State University Department of Computing and Information Sciences CIS 732: Machine Learning and Pattern Recognition Thursday, 05 April 2007 William.
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.
Eick: kNN kNN: A Non-parametric Classification and Prediction Technique Goals of this set of transparencies: 1.Introduce kNN---a popular non-parameric.
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.
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.
1 Instance Based Learning Soongsil University Intelligent Systems Lab.
Instance Based Learning
Ch8: Nonparametric Methods
Classification Nearest Neighbor
Data Mining: Concepts and Techniques (3rd ed
K-Nearest Neighbours and Instance based learning
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
Chap 8. Instance Based Learning
Machine Learning: UNIT-4 CHAPTER-1
Nearest Neighbor Classifiers
Presentation transcript:

1 Instance Based Learning Ata Kaban The University of Birmingham

2 Today we learn: n K-Nearest Neighbours n Locally weighted regression n Case-based reasoning n Lazy and eager learning

3 Instance-based learning n One way of solving tasks of approximating discrete or real valued target functions n Have training examples: (x n, f(x n )), n=1..N. n Key idea: –just store the training examples –when a test example is given then find the closest matches

4 n 1-Nearest neighbour: Given a query instance x q, first locate the nearest training example x n then f(x q ):= f(x n ) n K-Nearest neighbour: Given a query instance x q, first locate the k nearest training examples if discrete values target function then take vote among its k nearest nbrs else if real valued target fct then take the mean of the f values of the k nearest nbrs

5 The distance between examples n We need a measure of distance in order to know who are the neighbours n Assume that we have T attributes for the learning problem. Then one example point x has elements x t  , t=1,…T. The distance between two points x i x j is often defined as the Euclidean distance:

6 Voronoi Diagram

7 Characteristics of Inst-b-Learning n An instance-based learner is a lazy-learner and does all the work when the test example is presented. This is opposed to so-called eager-learners, which build a parameterised compact model of the target. It produces local approximation to the target function (different with each test instance)

8 When to consider Nearest Neighbour algorithms? n Instances map to points in n Not more then say 20 attributes per instance n Lots of training data n Advantages: –Training is very fast –Can learn complex target functions –Don’t lose information n Disadvantages: –? (will see them shortly…)

9 two one four three five six seven Eight ?

10 Training data Test instance

11 Keep data in normalised form One way to normalise the data a r (x) to a´ r (x) is

12 Normalised training data Test instance

13 Distances of test instance from training data Classification 1-NNYes 3-NNYes 5-NNNo 7-NNNo

14 What if the target function is real valued? n The k-nearest neighbour algorithm would just calculate the mean of the k nearest neighbours

15 Variant of kNN: Distance-Weighted kNN n We might want to weight nearer neighbors more heavily n Then it makes sense to use all training examples instead of just k (Stepard’s method)

16 Difficulties with k-nearest neighbour algorithms n Have to calculate the distance of the test case from all training cases n There may be irrelevant attributes amongst the attributes – curse of dimensionality

17 A generalisation: Locally Weighted Regression n Some useful terminology –Regression = approximating a real valued function –Residual error = the error in approximating the target function –Kernel function = the function of distance that is used to determine the weight of each training example, I.e.

18 (Locally Weighted Regression) n Note kNN forms local approximations to f for each query point n Why not form an explicit local approximation for regions surrounding the query point, e.g. –Fit a linear function to the k nearest neighbours (or a quadratic, …) e.g. –…

19 Case-based reasoning (CBR) n CBR is an advanced instance based learning applied to more complex instance objects n Objects may include complex structural descriptions of cases & adaptation rules n It doesn’t use Euclidean distance measures but can do matching between objects using e.g. semantic nets. n It tries to model human problem-solving –uses past experience (cases) to solve new problems –retains solutions to new problems n CBR is an ongoing area of machine learning research with many applications

20 Applications of CBR n Design –landscape, building, mechanical, conceptual design of aircraft sub-systems n Planning –repair schedules n Diagnosis –medical n Adversarial reasoning –legal

21 CBR process New Case matching Matched Cases Retrieve Adapt? No Yes Closest Case Suggest solution Retain Learn Revise Reuse Case Base Knowledge and Adaptation rules

22 CBR example: Property pricing Test instance

23 How rules are generated n Examine cases and look for ones that are almost identical –case 1 and case 2 R1: If recep-rooms changes from 2 to 1 then reduce price by £5,000 –case 3 and case 4 R2: If Type changes from semi to terraced then reduce price by £7,000

24 Matching n Comparing test instance –matches(5,1) = 3 –matches(5,2) = 3 –matches(5,3) = 2 –matches(5,4) = 1 n Estimate price of case 5 is £25,000

25 Adapting n Reverse rule 2 –if type changes from terraced to semi then increase price by £7,000 n Apply reversed rule 2 –new estimate of price of property 5 is £32,000

26 Learning n So far we have a new case and an estimated price –nothing is added yet to the case base n If later we find house sold for £35,000 then the case would be added –could add a new rule if location changes from 8 to 7 increase price by £3,000

27 Problems with CBR n How should cases be represented? n How should cases be indexed for fast retrieval? n How can good adaptation heuristics be developed? n When should old cases be removed?

28 Advantages n An local approximation is found for each test case n Knowledge is in a form understandable to human beings n Fast to train

29 Summary n K-Nearest Neighbour n (Locally weighted regression) n Case-based reasoning n Lazy and eager learning

30 Lazy and Eager Learning n Lazy: wait for query before generalizing –k-Nearest Neighbour, Case based reasoning n Eager: generalize before seeing query –Radial Basis Function Networks, ID3, … n Does it matter? –Eager learner must create global approximation –Lazy learner can create many local approximations