20.3 Implement a chosen impurity measure by writing the impurity1 predicate. This measure can be, for example,

Question:

20.3 Implement a chosen impurity measure by writing the impurity1 predicate. This measure can be, for example, the residual information content or Gini index as discussed previously in this section. For the examples in Figure 20.9 and attribute size, use of the Gini index as impurity measure gives: ?- Examples = ... impurity1( Examples, size, Impurity). Impurity 0.647619 % Examples from Figure 20.9 Approximating probabilities by relative frequencies, Impurity is calculated as follows: Impurity Gini( size) p(small)(p(nut | small) *p(screw | small) +...) + p(large) * (...) =7/12 (3/7 2/7+...) + 5/12 * (...) = 7/12 0.653061 + 5/12 * 0.64 = * = 0.647619

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: