; Since the first example wasn't such a great example, I've produced
; this example by raising the threshold for considering the
; irrelevant-attribute hypothesis true to 0.05. The code you submit,
; however, should use 0.001
;
> (chi^2-learn-dtree restaurant-data restaurant-names)
Training data have mixed classification; splitting on some attribute.
Splitting on alternate yields:
(no yes)
(((yes 3) (no 3)) ((no 3) (yes 3)))
The information on this split is:
(1. 1.)
Splitting on bar yields:
(yes no)
(((no 3) (yes 3)) ((yes 3) (no 3)))
The information on this split is:
(1. 1.)
Splitting on fri yields:
(yes no)
(((no 3) (yes 2)) ((yes 4) (no 3)))
The information on this split is:
(.9709505944546686 .9852281360342516)
Splitting on hungry yields:
(no yes)
(((yes 1) (no 4)) ((no 2) (yes 5)))
The information on this split is:
(.7219280948873623 .863120568566631)
Splitting on patrons yields:
(none full some)
(((no 2)) ((no 4) (yes 2)) ((yes 4)))
The information on this split is:
(0 .9182958340544896 0)
Splitting on price yields:
($$ $ $$$)
(((yes 2)) ((no 4) (yes 3)) ((yes 1) (no 2)))
The information on this split is:
(0 .9852281360342516 .9182958340544896)
Splitting on rain yields:
(yes no)
(((yes 2) (no 2)) ((no 4) (yes 4)))
The information on this split is:
(1. 1.)
Splitting on reservation yields:
(no yes)
(((no 4) (yes 3)) ((yes 3) (no 2)))
The information on this split is:
(.9852281360342516 .9709505944546686)
Splitting on type yields:
(italian burger thai french)
(((yes 1) (no 1)) ((no 2) (yes 2)) ((yes 2) (no 2)) ((yes 1) (no 1)))
The information on this split is:
(1. 1. 1. 1.)
Splitting on wait-estimate yields:
(above60 upto30 upto60 upto10)
(((no 2)) ((yes 1) (no 1)) ((no 1) (yes 1)) ((yes 4) (no 2)))
The information on this split is:
(0 1. 1. .9182958340544896)
The information required after splitting on alternate is 1..
The information required after splitting on bar is 1..
The information required after splitting on fri is .9792791603760922.
The information required after splitting on hungry is .8042903712002691.
The information required after splitting on patrons is .4591479170272448.
The information required after splitting on price is .8042903712002692.
The information required after splitting on rain is 1..
The information required after splitting on reservation is .9792791603760922.
The information required after splitting on type is .9999999999999999.
The information required after splitting on wait-estimate is .792481250360578.
The attribute with greatest information gain is patrons.
The attribute patrons was chosen as the best.
Checking statistical significance...
Examining split for value "some"
There are 4 examples in this split.
For the classification no, 2. are expected. (A fraction of .5)
There were actually 0 for a difference of -2.
This contributes 2. to Q.
For the classification yes, 2. are expected. (A fraction of .5)
There were actually 4. for a difference of 2.
This contributes 2. to Q.
Examining split for value "full"
There are 6 examples in this split.
For the classification no, 3. are expected. (A fraction of .5)
There were actually 4. for a difference of 1.
This contributes .33 to Q.
For the classification yes, 3. are expected. (A fraction of .5)
There were actually 2. for a difference of -1.
This contributes .33 to Q.
Examining split for value "none"
There are 2 examples in this split.
For the classification no, 1. are expected. (A fraction of .5)
There were actually 2. for a difference of 1.
This contributes 1. to Q.
For the classification yes, 1. are expected. (A fraction of .5)
There were actually 0 for a difference of -1.
This contributes 1. to Q.
Evaluating statistical significance with dof=2 and Q=6.67
Probability value is .0356739933472524
==> statistically significant, i.e. the theory that this attribute
is irrelevant is deemed to be FALSE (probability <= .05)
Splitting on this attribute.
Now working on the split for the patrons="none" with examples:((no (no no no no none $ no no thai upto10))
(no (no yes no no none $ yes no burger upto10)))
All data have the same classification of: no.
Now working on the split for the patrons="full" with examples:((yes (yes yes yes yes full $ no no burger upto60))
(no (yes yes yes yes full $$$ no yes italian upto30))
(no (no yes yes no full $ yes no burger above60))
(no (yes no yes no full $$$ no yes french above60))
(yes (yes no yes yes full $ no no thai upto30))
(no (yes no no yes full $ no no thai upto60)))
Training data have mixed classification; splitting on some attribute.
Splitting on alternate yields:
(no yes)
(((no 1)) ((yes 2) (no 3)))
The information on this split is:
(0 .9709505944546686)
Splitting on bar yields:
(no yes)
(((yes 1) (no 2)) ((yes 1) (no 2)))
The information on this split is:
(.9182958340544896 .9182958340544896)
Splitting on fri yields:
(no yes)
(((no 1)) ((no 3) (yes 2)))
The information on this split is:
(0 .9709505944546686)
Splitting on hungry yields:
(no yes)
(((no 2)) ((yes 2) (no 2)))
The information on this split is:
(0 1.)
Splitting on price yields:
($$$ $)
(((no 2)) ((yes 2) (no 2)))
The information on this split is:
(0 1.)
Splitting on rain yields:
(yes no)
(((no 1)) ((yes 2) (no 3)))
The information on this split is:
(0 .9709505944546686)
Splitting on reservation yields:
(yes no)
(((no 2)) ((yes 2) (no 2)))
The information on this split is:
(0 1.)
Splitting on type yields:
(thai french italian burger)
(((yes 1) (no 1)) ((no 1)) ((no 1)) ((yes 1) (no 1)))
The information on this split is:
(1. 0 0 1.)
Splitting on wait-estimate yields:
(above60 upto30 upto60)
(((no 2)) ((no 1) (yes 1)) ((yes 1) (no 1)))
The information on this split is:
(0 1. 1.)
The information required after splitting on alternate is .8091254953788906.
The information required after splitting on bar is .9182958340544896.
The information required after splitting on fri is .8091254953788906.
The information required after splitting on hungry is .6666666666666666.
The information required after splitting on price is .6666666666666666.
The information required after splitting on rain is .8091254953788906.
The information required after splitting on reservation is .6666666666666666.
The information required after splitting on type is .6666666666666666.
The information required after splitting on wait-estimate is .6666666666666666.
The attribute with greatest information gain is hungry.
The attribute hungry was chosen as the best.
Checking statistical significance...
Examining split for value "yes"
There are 4 examples in this split.
For the classification no, 2.67 are expected. (A fraction of .67)
There were actually 2. for a difference of -.67
This contributes .17 to Q.
For the classification yes, 1.33 are expected. (A fraction of .33)
There were actually 2. for a difference of .67
This contributes .33 to Q.
Examining split for value "no"
There are 2 examples in this split.
For the classification no, 1.33 are expected. (A fraction of .67)
There were actually 2. for a difference of .67
This contributes .33 to Q.
For the classification yes, .67 are expected. (A fraction of .33)
There were actually 0 for a difference of -.67
This contributes .67 to Q.
Evaluating statistical significance with dof=1 and Q=1.5
Probability value is .22067136399011844
==> NOT statistically significant, i.e. the theory that this attribute
is irrelevant is deemed to be TRUE (probability > .05)
Recursing to pick majority classification.
No more attributes to split upon
Taking the majority which is: no
Now working on the split for the patrons="some" with examples:((yes (no no no yes some $$ yes yes thai upto10))
(yes (no yes no yes some $$ yes yes italian upto10))
(yes (no yes no no some $ no no burger upto10))
(yes (yes no no yes some $$$ no yes french upto10)))
All data have the same classification of: yes.
;Value 7: (patrons (none no) (full no) (some yes))