ch. 19 – knowledge in learning

6
Ch. 19 – Knowledge in Learning Supplemental slides for CSE 327 Prof. Jeff Heflin

Upload: seth-bright

Post on 31-Dec-2015

17 views

Category:

Documents


0 download

DESCRIPTION

Ch. 19 – Knowledge in Learning. Supplemental slides for CSE 327 Prof. Jeff Heflin. Current Best Hypothesis Search. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Ch. 19 – Knowledge in Learning

Ch. 19 – Knowledge in Learning

Supplemental slides for CSE 327

Prof. Jeff Heflin

Page 2: Ch. 19 – Knowledge in Learning

Current Best Hypothesis Search

function CURRENT-BEST-LEARNING(examples) returns a hypothesisH any hypothesis consistent with the first example in examplesfor each remaining example in examples do

if e is false positive for H thenH choose a specialization of H consistent with examples

else if e is false negative for H thenH choose a generalization of H consistent with examples

if no consistent specialization/generalization can be found then failreturn H

Note: here choose is a special operator that allows you to backtrack to a previous choice and select another option when the search fails. An actual implementation would probably use depth-first search instead.

From Figure 19.2, p. 681

Page 3: Ch. 19 – Knowledge in Learning

Example Learning Problem

Example Descriptions Classifications

X1 Color(X1,Red) Shape(X1,Circle) Size(X1,Large) Q(X1)

X2 Color(X2,Blue) Shape(X2,Square) Size(X2,Small) Q(X2)

X3 Color(X3,Red) Shape(X3,Square) Size(X3,Small) Q(X3)

X4 Color(X4,Green) Shape(X4,Triangle) Size(X4,Large) Q(X4)

X5 Color(X5,Red) Shape(X5,Circle) Size(X5,Small) Q(X5)

Only consider candidate definitions that are positive conjunctive sentences

Training Set

Page 4: Ch. 19 – Knowledge in Learning

Version Space Learning

function VERSION-SPACE-LEARNING(examples)returns a version spacelocal variables: V, the version space (the set of all hypotheses)V the set of all hypothesesfor each example e in examples do

if V is not empty thenV VERSION-SPACE-UPDATE(V,e)

return V

function VERSION-SPACE-UPDATE(V,e)returns an updated version spaceV {h V: h is consistent with e}return V

From Figure 19.3, p. 683

Page 5: Ch. 19 – Knowledge in Learning

Version Space Update Details

function VERSION-SPACE-UPDATE(G,S,e)returns an updated G-set and S-set (version space) for each g in G

if e is a false positive for gG G – gG G {h : h is the most general specialization of g that is consistent

with e and h is more general than some member of S}if e is a false negative for g

G G – g for each s in S

if e is a false positive for sS S – s

if e is a false negative for sS S – sS S {h : h is the most specific generalization of s that is consistent

with e and h is more specific than some member of G}return G,S

Page 6: Ch. 19 – Knowledge in Learning

Example Learning Problem

Only consider candidate definitions that are positive conjunctive sentences

Training Set

Descriptions Classifications

Size(X1,Large) Shape(X1,Circle) Color(X1,Red) Q(X1)

Size(X2,Large) Shape(X2,Square) Color(X2,Blue) Q(X2)

Size(X3,Small) Shape(X3,Circle) Color(X3,Red) Q(X3)

Size(X4,Small) Shape(X4,Circle) Color(X4,Blue) Q(X4)

Size(X5,Large) Shape(X5,Square) Color(X5,Red) Q(X5)