90 likes | 168 Views
Ch. 19 – Knowledge in Learning. Supplemental slides for CSE 327 Prof. Jeff Heflin. Current Best Hypothesis Search.
E N D
Ch. 19 – Knowledge in Learning Supplemental slides for CSE 327 Prof. Jeff Heflin
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 examplesdo ife is false positive for HthenH choose a specialization of H consistent with examples else ife is false negative for HthenH choose a generalization of H consistent with examplesif no consistent specialization/generalization can be found then failreturnH Note: here chooseis 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
Example Learning Problem (current best hypothesis search) Training Set Only consider candidate definitions that are positive conjunctive sentences
Current-Best Hypothesis Search 1 True hypothesis X1: ok example: status 2 FP = false positive True FN = false negative X2: FP 3 Color(x,Red) Shape(x,Circle) X3: FP X3: ? 4 6 Color(x,Red) Size(x,Large) Color(x,Red) Shape(x,Circle) X4: ok X4: ok 5 Color(x,Red) Size(x,Large) 7 Color(x,Red) Shape(x,Circle) X5: FN X5: ok
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 examplesdo ifV is not empty thenV VERSION-SPACE-UPDATE(V,e)returnV function VERSION-SPACE-UPDATE(V,e)returns an updated version space V {h V: h is consistent with e}returnV From Figure 19.3, p. 683
Ordering on Hypothesis Space P(x) Q(x) R(x) P(x) Q(x) P(x) R(x) Q(x) R(x) P(x) Q(x) R(x)
Version Space Update Details function VERSION-SPACE-UPDATE(G,S,e)returns an updated G-set and S-set (version space) for eachg in Gife is a false positive for g G 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}else ife is a false negative for g G G – gfor eachs in Sife is a false positive for s S S – selse ife is a false negative for s S 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} returnG,S
Example Learning Problem (version space learning) Training Set Only consider candidate definitions that are positive conjunctive sentences