EECS 349: Machine Learning

Similar documents
Machine Learning 2D1431. Lecture 3: Concept Learning

Question of the Day? Machine Learning 2D1431. Training Examples for Concept Enjoy Sport. Outline. Lecture 3: Concept Learning

Concept Learning. Space of Versions of Concepts Learned

Concept Learning through General-to-Specific Ordering

Concept Learning Mitchell, Chapter 2. CptS 570 Machine Learning School of EECS Washington State University

Concept Learning. Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University.

Concept Learning. Berlin Chen References: 1. Tom M. Mitchell, Machine Learning, Chapter 2 2. Tom M. Mitchell s teaching materials.

Overview. Machine Learning, Chapter 2: Concept Learning

[read Chapter 2] [suggested exercises 2.2, 2.3, 2.4, 2.6] General-to-specific ordering over hypotheses

Introduction to machine learning. Concept learning. Design of a learning system. Designing a learning system

Version Spaces.

Concept Learning.

Outline. [read Chapter 2] Learning from examples. General-to-specic ordering over hypotheses. Version spaces and candidate elimination.

Fundamentals of Concept Learning

EECS 349: Machine Learning Bryan Pardo

Outline. Training Examples for EnjoySport. 2 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997

Lecture 2: Foundations of Concept Learning

CSCE 478/878 Lecture 2: Concept Learning and the General-to-Specific Ordering

BITS F464: MACHINE LEARNING

Computational Learning Theory

Computational Learning Theory

Answers Machine Learning Exercises 2

Topics. Concept Learning. Concept Learning Task. Concept Descriptions

Computational Learning Theory

Tutorial 6. By:Aashmeet Kalra

Data Mining and Machine Learning

Computational Learning Theory

EECS 349:Machine Learning Bryan Pardo

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

Introduction to Machine Learning

Classification (Categorization) CS 391L: Machine Learning: Inductive Classification. Raymond J. Mooney. Sample Category Learning Problem

Machine Learning. Computational Learning Theory. Eric Xing , Fall Lecture 9, October 5, 2016

Introduction to Machine Learning

Machine Learning. Computational Learning Theory. Le Song. CSE6740/CS7641/ISYE6740, Fall 2012

Computational Learning Theory

Computational Learning Theory (COLT)

Bayesian Learning Features of Bayesian learning methods:

Typical Supervised Learning Problem Setting

Lecture 3: Decision Trees

Notes on Machine Learning for and

The Bayesian Learning

Introduction to Machine Learning

Decision Tree Learning and Inductive Inference

Lecture Notes in Machine Learning Chapter 4: Version space learning

Lecture 25 of 42. PAC Learning, VC Dimension, and Mistake Bounds

Lecture 3: Decision Trees

Lecture 9: Bayesian Learning

Question of the Day. Machine Learning 2D1431. Decision Tree for PlayTennis. Outline. Lecture 4: Decision Tree Learning

CS 6375: Machine Learning Computational Learning Theory

Decision Tree Learning Mitchell, Chapter 3. CptS 570 Machine Learning School of EECS Washington State University

Linear Classifiers: Expressiveness

Computational Learning Theory

Hypothesis Testing and Computational Learning Theory. EECS 349 Machine Learning With slides from Bryan Pardo, Tom Mitchell

Lattice Machine: Version Space in Hyperrelations

B555 - Machine Learning - Homework 4. Enrique Areyan April 28, 2015

Decision Trees.

Decision Tree Learning

CSCE 478/878 Lecture 6: Bayesian Learning

T Machine Learning: Basic Principles

Applied Logic. Lecture 4 part 2 Bayesian inductive reasoning. Marcin Szczuka. Institute of Informatics, The University of Warsaw

M chi h n i e n L e L arni n n i g Decision Trees Mac a h c i h n i e n e L e L a e r a ni n ng

Learning Classification Trees. Sargur Srihari

Introduction to ML. Two examples of Learners: Naïve Bayesian Classifiers Decision Trees

Computational Learning Theory. Definitions

A Tutorial on Computational Learning Theory Presented at Genetic Programming 1997 Stanford University, July 1997

Chapter 3: Decision Tree Learning

Decision Tree Learning

Computational learning theory. PAC learning. VC dimension.

CS 6375 Machine Learning

Midterm Exam, Spring 2005

Decision Trees.

Decision-Tree Learning. Chapter 3: Decision Tree Learning. Classification Learning. Decision Tree for PlayTennis

Machine Learning

Bayesian Classification. Bayesian Classification: Why?

Machine Learning Alternatives to Manual Knowledge Acquisition

Statistical Learning Learning From Examples

Topics. Bayesian Learning. What is Bayesian Learning? Objectives for Bayesian Learning

CS 380: ARTIFICIAL INTELLIGENCE MACHINE LEARNING. Santiago Ontañón

Machine Learning 2007: Slides 1. Instructor: Tim van Erven Website: erven/teaching/0708/ml/

Machine Learning

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Machine Learning: Exercise Sheet 2

Artificial Intelligence. Topic

Course 395: Machine Learning

Decision Trees Part 1. Rao Vemuri University of California, Davis

Bayesian Learning. Artificial Intelligence Programming. 15-0: Learning vs. Deduction

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

Introduction. Decision Tree Learning. Outline. Decision Tree 9/7/2017. Decision Tree Definition

Decision Tree Learning

Warm-Up Problem. Is the following true or false? 1/35

Dan Roth 461C, 3401 Walnut

1. Courses are either tough or boring. 2. Not all courses are boring. 3. Therefore there are tough courses. (Cx, Tx, Bx, )

Classification and Prediction

Decision Trees. Nicholas Ruozzi University of Texas at Dallas. Based on the slides of Vibhav Gogate and David Sontag

Supervised Learning! Algorithm Implementations! Inferring Rudimentary Rules and Decision Trees!

Naïve Bayes Classifiers

CS 446 Machine Learning Fall 2016 Nov 01, Bayesian Learning

Text Categorization CSE 454. (Based on slides by Dan Weld, Tom Mitchell, and others)

Logic, Sets, and Proofs

Estimating the accuracy of a hypothesis Setting. Assume a binary classification setting

Transcription:

EECS 349: Machine Learning Bryan Pardo Topic 1: Concept Learning and Version Spaces (with some tweaks by Doug Downey) 1

Concept Learning Much of learning involves acquiring general concepts from specific training examples Concept: subset of objects from some space Concept learning: Defining a function that specifies which elements are in the concept set. 2

A Concept Let there be a set of objects, X. X = {White Fang, Scooby Doo, Wile E, Lassie} A concept C is A subset of X C = dogs = {Lassie, Scooby Doo} A function that returns 1 only for elements in the concept C(Lassie) = 1, C(Wile E) = 0 3

Instance Representation Represent an object (or instance) as an n-tuple of attributes Example: Days (6-tuples) Sky Temp Humid Wind Water Forecast sunny warm normal strong warm same sunny warm high strong warm same rainy cold high strong warm change sunny warm high strong cool change 4

Example Concept Function Days on which my friend Aldo enjoys his favorite water sport INPUT OUTPUT Sky Temp Humid Wind Water Forecast C(x) sunny warm normal strong warm same 1 sunny warm high strong warm same 1 rainy cold high strong warm change 0 sunny warm high strong cool change 1 5

Hypothesis Spaces Hypothesis Space H: subset of all possible concepts For learning, we restrict ourselves to H H may be only a small subset of all possible concepts (this turns out to be important more later)

Example: MC2 Hypothesis Space MC2 (Mitchell, Chapter 2) hypothesis space Hypothesis h is a conjunction of constraints on attributes Each constraint can be: A specific value : e.g. Water=Warm A don t care value : e.g. Water=? No value allowed: e.g. Water=Ø Instances x that satisfy the constraints of h have h(x) = 1, otherwise h(x) = 0 Example hypotheses: Sky Temp Humid Wind Water Forecast sunny?????? warm??? same 7

Concept Learning Task GIVEN: Instances X E.g., days decribed by attributes: Sky, Temp, Humidity, Wind, Water, Forecast Target function c: E.g., EnjoySport X {0,1} Hypothesis space H E.g. MC2, conjunction of literals: < Sunny?? Strong? Same > Training examples D positive and negative examples of the target function: <x 1,c(x 1 )>,, <x n,c(x n )> FIND: A hypothesis h in H such that h(x)=c(x) for all x in D. 8

Concept Learning Task GIVEN: Instances X E.g., days decribed by attributes: Sky, Temp, Humidity, Wind, Water, Forecast Target function c: E.g., EnjoySport X {0,1} Hypothesis space H E.g. MC2, conjunction of literals: < Sunny?? Strong? Same > Training examples D positive and negative examples of the target function: <x 1,c(x 1 )>,, <x n,c(x n )> FIND: A hypothesis h in H such that h(x)=c(x) for all x in D. 9

Inductive Learning Hypothesis Any hypothesis found to approximate the target function well over the training examples, will also approximate the target function well over the unobserved examples. This might not be true. When it it isn t the hypothesis does not generalize well.

Number of Instances, Concepts, Hypotheses Sky: Sunny, Cloudy, Rainy AirTemp: Warm, Cold Humidity: Normal, High Wind: Strong, Weak Water: Warm, Cold Forecast: Same, Change distinct instances : distinct concepts: 3*2*2*2*2*2 = 96 2 96 5*4*4*4*4*4=5120 syntactically distinct hypotheses in MC2: semantically distinct hypotheses in MC2: Number of possible hypothesis spaces: 1+4*3*3*3*3*3=973 2 96 2 11

Concept Generality A concept P is more general than or equal to another concept Q iff the set of instances represented by P includes the set of instances represented by Q. Mammal Wolf White_fang Canine Dog Lassie Scooby_doo Wilbur Pig Charlotte 12

General to Specific Order Consider two hypotheses: h 1 =< Sunny,?,?,Strong,?,?> h 2 =< Sunny,?,?,?,?,?> Definition: h j is more general than or equal to h k iff: h j h k x h k ( x) 1 h ( x) j 1 This imposes a partial order on a hypothesis space. 13

Instance, Hypotheses and generality Instances Hypotheses specific x 1 h 3 h 1 x 2 h 2 h 1 h 2 h 3 h 2 general x 1 =< Sunny,Warm,High,Strong,Cool,Same> x 2 =< Sunny,Warm,High,Light,Warm,Same> h 1 =< Sunny,?,?,Strong,?,?> h 2 =< Sunny,?,?,?,?,?> h 3 =< Sunny,?,?,?,Cool,?> 14

Find-S Algorithm 1. Initialize h to the most specific hypothesis in H 2. For each positive training instance x: For each attribute constraint a i in h If the constraint is satisfied by x, do nothing else replace a i in h by the next more general constraint that is satisfied by x 3. Output hypothesis h 15

Hypothesis Space Search by Find-S x 3 Instances Hypotheses h 0 specific x 1 x 2 h 1 h 2,3 x 4 h 4 general x 1 =<Sunny,Warm,Normal,Strong,Warm,Same>+ x 2 =<Sunny,Warm,High,Strong,Warm,Same>+ x 3 =<Rainy,Cold,High,Strong,Warm,Change> - x 4 =<Sunny,Warm,High,Strong,Cool,Change> + h 0 =< Ø, Ø, Ø, Ø, Ø, Ø,> h 1 =< Sunny,Warm,Normal, Strong,Warm,Same> h 2,3 =< Sunny,Warm,?, Strong,Warm,Same> h 4 =< Sunny,Warm,?, Strong,?,?> 16

Properties of Find-S When hypothesis space described by constraints on attributes (e.g., MC2) Find-S will output the most specific hypothesis within H that is consistent with the positve training examples 17

Complaints about Find-S Ignores negative training examples Why prefer the most specific hypothesis? Can t tell if the learner has converged to the target concept, in the sense that it is unable to determine whether it has found the only hypothesis consistent with the training examples. 18

Version Spaces Hypothesis h is consistent with a set of training examples D of the target concept c iff h(x)=c(x) for each training example <x,c(x)> in D. x, c( x) D h( x) c( ) Consistent ( h, D) x A version space : all the hypotheses that are consistent with the training examples. VS H, D { h H Consistent ( h, D)} Imposing a partial order (like the one) on the version space lets us learn concepts in an organized way. 19

List-Then Eliminate Algorithm 1. VersionSpace a list containing every hypothesis in H 2. For each training example <x,c(x)> remove from VersionSpace any hypothesis that is inconsistent with the training example h(x) c(x) 3. Output the list of hypotheses in VersionSpace 20

Example Version Space S: {<Sunny,Warm,?,Strong,?,?>} <Sunny,?,?,Strong,?,?> <Sunny,Warm,?,?,?,?> <?,Warm,?,Strong,?,?> G: {<Sunny,?,?,?,?,?>, <?,Warm,?,?,?>, } x 1 = <Sunny Warm Normal Strong Warm Same> + x 2 = <Sunny Warm High Strong Warm Same> + x 3 = <Rainy Cold High Strong Warm Change> - x 4 = <Sunny Warm High Strong Cool Change> + 21

Representing Version Spaces The general boundary, G, of version space VS H,D is the set of maximally general members. The specific boundary, S, of version space VS H,D is the set of maximally specific members. Every member of the version space lies between these boundaries VS H, D { h H ( s S), ( g G) g h s} 22

Candidate Elimination Algorithm 23

Candidate-Elimination Algorithm When does this halt? If S and G are both singleton sets, then: if they are identical, output value and halt. if they are different, the training cases were inconsistent. Output this and halt. Else continue accepting new training examples. 24

Example Candidate Elimination S: {<,,,,, >} G: {<?,?,?,?,?,?>} x 1 = <Sunny Warm Normal Strong Warm Same> + S: G: {< Sunny Warm Normal Strong Warm Same >} {<?,?,?,?,?,?>} x 2 = <Sunny Warm High Strong Warm Same> + S: {< Sunny Warm? Strong Warm Same >} G: {<?,?,?,?,?,?>} 25

Example Candidate Elimination S: G: {< Sunny Warm? Strong Warm Same >} {<?,?,?,?,?,?>} x 3 = <Rainy Cold High Strong Warm Change> - S: {< Sunny Warm? Strong Warm Same >} G: {<Sunny,?,?,?,?,?>, <?,Warm,?,?,?,?>, <?,?,?,?,?,Same>} x 4 = <Sunny Warm High Strong Cool Change> + S: {< Sunny Warm? Strong?? >} G: {<Sunny,?,?,?,?,?>, <?,Warm,?,?,?> } 26

Example Candidate Elimination Instance space: integer points in the x,y plane with 0 x,y 10 hypothesis space : rectangles. That means hypotheses are of the form a x b, c y d d c a b 27

Example Candidate Elimination examples = {ø} G={0,10,0,10} S={ø} G 28

Example Candidate Elimination examples = {(3,4),+} G={(0,10,0,10)} S={(3,3,4,4)} G S + 29

Classification of Unseen Data S: {<Sunny,Warm,?,Strong,?,?>} <Sunny,?,?,Strong,?,?> <Sunny,Warm,?,?,?,?> <?,Warm,?,Strong,?,?> G: {<Sunny,?,?,?,?,?>, <?,Warm,?,?,?>, } x 5 = <Sunny Warm Normal Strong Cool Change> x 6 = <Rainy Cold Normal Light Warm Same> x 7 = <Sunny Warm Normal Light Warm Same> x 8 = <Sunny Cold Normal Strong Warm Same> + 6/0-0/6? 3/3? 2/4 30

Inductive Leap + <Sunny Warm Normal Strong Cool Change> + <Sunny Warm Normal Light Warm Same> S : <Sunny Warm Normal???> new example <Sunny Warm Normal Strong Warm Same> How can we justify classifying the new example as positive? Since S is the specific boundary all other hypotheses in the version space are more general. So if the example satifies S it will also satisfy every other hypothesis in VS. inductive bias: Concept c can be described by a conjunction of literals. 31

What Example to Query Next? S: {<Sunny,Warm,?,Strong,?,?>} <Sunny,?,?,Strong,?,?> <Sunny,Warm,?,?,?,?> <?,Warm,?,Strong,?,?> G: {<Sunny,?,?,?,?,?>, <?,Warm,?,?,?>, } What would be a good query for the learner to pose at this point? Choose an instance that is classified positive by some of the hypotheses and negative by the others. <Sunny, Warm, Normal, Light, Warm, Same> If the example is positive S can be generalized, if it is negative G can be specialized. 32

Biased Hypothesis Space Our hypothesis space is unable to represent a simple disjunctive target concept : (Sky=Sunny) v (Sky=Cloudy) x 1 = <Sunny Warm Normal Strong Cool Change> + S 1 : { <Sunny, Warm, Normal, Strong, Cool, Change> } x 2 = <Cloudy Warm Normal Strong Cool Change> + S 2 : { <?, Warm, Normal, Strong, Cool, Change> } x 3 = <Rainy Warm Normal Strong Cool Change> - S 3 : {} The third example x 3 contradicts the already overly general hypothesis space specific boundary S 2. 33

Unbiased Learner Idea: Choose H that expresses every teachable concept, that means H is the set of all possible subsets of X X =96 => H =2 96 ~ 10 28 distinct concepts H = disjunctions, conjunctions, negations <Sunny Warm Normal???> v <????? Change> H surely contains the target concept. 34

Unbiased Learner Assume positive examples (x 1, x 2, x 3 ) and negative examples (x 4, x 5 ) S : { (x 1 v x 2 v x 3 ) } G : { (x 4 v x 5 ) } How would we classify some new instance x 6? For any instance not in the training examples half of the version space says + the other half says => To learn the target concept one would have to present every single instance in X as a training example (Rote learning) 35

Three Learners with Different Biases Rote learner: Store examples, classify x if and only if it matches a previously observed example. No inductive bias Version space candidate elimination algorithm. Bias: Hypothesis space contains target concept. Find-S Bias: The hypothesis space contains the target concept & all instances are negative instances unless the opposite is entailed by other knowledge. 36

Summary Concept learning as search. General-to-Specific partial ordering of hypotheses Inductive learning algorithms can classify unseen examples only because of inductive bias An unbiased learner cannot make inductive leaps to classify unseen examples. 37