Concept Learning

Candidate Elimination Algorithm

  1. $G \leftarrow$ maximally general hypotheses in $H$
  2. $S \leftarrow$ maximally specific hypotheses in $H$
  3. For each training example $d$, do
    1. If $d$ is a positive example then:
      1. Remove from $G$ any hypothesis inconsistent with $d$
      2. For each hypothesis $s$ in $S$ that is not consistent with $d$
      3. Remove $s$ from $S$
      4. Add to $S$ all minimal generalizations $h$ of $s$ such that $h$ is consistent with $d$, and some member of $G$ is more general than $h$
      5. Remove from $S$ any hypothesis that is more general than another hypothesis in $S$
    2. else if $d$ is a negative example:
      1. Remove from $S$ any hypothesis inconsistent with $d$
      2. For each hypothesis $g$ in $G$ that is not consistent with $d$
        1. Remove $g$ from $G$
        2. Add to $G$ all minimal specializations $h$ of $g$ such that $h$ is consistent with $d$, and some member of $S$ is more specific than $h$.
        3. Remove from $G$ any hypothesis that is less general than another hypothesis in $G$

José M. Vidal .

19 of 31