Data from http://www.ics.uci.edu/~mlearn/databases/mushroom/ {break} 1. Title: Mushroom Database{break}{break} 2. Sources: {break} {space 4}(a) Mushroom records drawn from The Audubon Society Field Guide to {break} {space 6}North American Mushrooms (1981). G. H. Lincoff (Pres.), {break} {space 6}New York: Alfred A. Knopf{break} {space 4}(b) Donor: Jeff Schlimmer (Jeffrey.Schlimmer@a.gp.cs.cmu.edu){break} {space 4}(c) Date: 27 April 1987 {break} {break} 3. Past Usage:{break} {space 4}1. Schlimmer,J.S. (1987). Concept Acquisition Through Representational{break} {space 6}Adjustment (Technical Report 87-19).  Doctoral disseration, {break} {space 6}Department of Information and Computer Science, University {break} {space 6}of California, Irvine.{break} {space 6}--- STAGGER: asymptoted to 95% classification accuracy after {break} {space 6}reviewing 1000 instances.{break} {space 4}2. Iba,W., Wogulis,J., & Langley,P. (1988).  Trading off Simplicity{break} {space 6}and Coverage in Incremental Concept Learning. In Proceedings of{break} {space 6}the 5th International Conference on Machine Learning, 73-79.{break} {space 6}Ann Arbor, Michigan: Morgan Kaufmann. {break} {space 6}-- approximately the same results with their HILLARY algorithm {break} {break} 4. Relevant Information: {break} {space 4}This data set includes descriptions of hypothetical samples {break} {space 4}corresponding to 23 species of gilled mushrooms in the Agaricus and {break} {space 4}Lepiota Family (pp. 500-525).  Each species is identified as {break} {space 4}definitely edible, definitely poisonous, or of unknown edibility and {break} {space 4}not recommended.  This latter class was combined with the poisonous {break} {space 4}one.  The Guide clearly states that there is no simple rule for {break} {space 4}determining the edibility of a mushroom; no rule like {break} {space 4} {c 'g}{c 'g}leaflets three, let it be'' for Poisonous Oak and Ivy. {break} {break} 5. Number of Instances: 8124 {break} {break} 6. Number of Attributes: 22 (all nominally valued){break}{break} 7. Attribute Information: (classes: edible=e, poisonous=p) {break} {space 4}1. cap-shape:{space 16}bell=b, conical=c, convex=x, flat=f, {break} {space 34}knobbed=k, sunken=s {break} {space 4}2. cap-surface:{space 15}fibrous=f, grooves=g, scaly=y, smooth=s {break} {space 4}3. cap-color:{space 17}brown=n, buff=b, cinnamon=c, gray=g, {break} {space 34}green=r, pink=p, purple=u, red=e, {break} {space 34} white=w, yellow=y{break} {space 4}4. bruises?:{space 18}bruises=t, no=f {break} {space 4}5. odor:{space 22}almond=a, anise=l, creosote=c, fishy=y, {break} {space 34}foul=f, musty=m, none=n, pungent=p, {break} {space 34}spicy=s {break} {space 4}6. gill-attachment:{space 11}attached=a, descending=d, free=f, {break} {space 34}notched=n{break} {space 4}7. gill-spacing:{space 14}close=c, crowded=w, distant=d {break} {space 4}8. gill-size:{space 17}broad=b, narrow=n {break} {space 4}9. gill-color:{space 16}black=k, brown=n, buff=b, chocolate=h,  {break} {space 34}gray=g, green=r, orange=o, pink=p, {break} {space 34}purple=u, red=e, white=w, yellow=y {break} {space 4}10. stalk-shape:{space 14}enlarging=e, tapering=t{break} {space 4}11. stalk-root:{space 15}bulbous=b, club=c, cup=u, equal=e, {break} {space 34}rhizomorphs=z, rooted=r, missing=?{break} {space 4}12. stalk-surface-above-ring: fibrous=f, scaly=y, silky=k,  smooth=s{break} {space 4}13. stalk-surface-below-ring: fibrous=f, scaly=y, silky=k,  smooth=s{break} {space 4}14. stalk-color-above-ring:{space 3}brown=n, buff=b, cinnamon=c, {break} {space 34}gray=g, orange=o, {break} {space 34}pink=p, red=e, white=w, yellow=y{break} {space 4}15. stalk-color-below-ring:{space 3}brown=n, buff=b, cinnamon=c, {break} {space 34}gray=g, orange=o, pink=p, red=e, {break} {space 34}white=w, yellow=y{break} {space 4}16. veil-type:{space 16}partial=p, universal=u{break} {space 4}17. veil-color:{space 15}brown=n, orange=o, white=w, yellow=y{break} {space 4}18. ring-number:{space 14}none=n, one=o, two=t{break} {space 4}19. ring-type:{space 16}cobwebby=c, evanescent=e, flaring=f, {break} {space 34}large=l, none=n, pendant=p, {break} {space 34}sheathing=s, zone=z{break} {space 4}20. spore-print-color:{space 8}black=k, brown=n, buff=b, chocolate=h, {break} {space 34}green=r, orange=o, purple=u, white=w, {break} {space 34}yellow=y{break} {space 4}21. population:{space 15}abundant=a, clustered=c, numerous=n, {break} {space 34}scattered=s, several=v, solitary=y{break} {space 4}22. habitat:{space 18}grasses=g, leaves=l, meadows=m, paths=p, {break} {space 34}urban=u, waste=w, woods=d{break}{break} 8. Missing Attribute Values: 2480 of them (denoted by "?"), all for{break} {space 4}attribute #11.{break} {break} 9. Class Distribution: {break} {space 4}--    edible: 4208 (51.8%) {break} {space 4}-- poisonous: 3916 (48.2%) {break} {space 4}--     total: 8124 instances {break}
This dataset was created from the mushroom database using the following commands: {break} {space 4}{inp:. infile using mushroom.txt, clear}{break} {space 4}{inp:. gen byte poison = 1 if edible == "p"}{break} {space 4}{inp:. replace poison = 0 if edible == "e"}{break} {space 4}{inp:. label define poison 0 "edible" 1 "poisonous"}{break} {space 4}{inp:. label values poison poison}{break} {space 4}{inp:. drop edible}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace capshape = "bell" if capshape== "b"}{break} {space 4}{inp:. replace capshape = "conical" if capshape == "c"}{break} {space 4}{inp:. replace capshape = "convex" if capshape == "x"}{break} {space 4}{inp:. replace capshape = "flat" if capshape == "f" }{break} {space 4}{inp:. replace capshape = "knobbed" if capshape == "k"}{break} {space 4}{inp:. replace capshape = "sunken" if capshape == "s"}{break} {space 4}{inp:. rename capshape capshape2}{break} {space 4}{inp:. encode capshape2, generate(capshape)}{break} {space 4}{inp:. drop capshape2}{break} {space 4}{inp:. label variable capshape "cap shape"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace capsurface = "fibrous" if capsurface == "f"}{break} {space 4}{inp:. replace capsurface = "grooves" if capsurface == "g"}{break} {space 4}{inp:. replace capsurface = "scaly" if capsurface == "y"}{break} {space 4}{inp:. replace capsurface = "smooth" if capsurface == "s"}{break} {space 4}{inp:. rename capsurface capsurface2}{break} {space 4}{inp:. encode capsurface2, generate(capsurface)}{break} {space 4}{inp:. drop capsurface2}{break} {space 4}{inp:. label variable capsurface "cap surface"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace capcolor = "brown" if capcolor == "n"}{break} {space 4}{inp:. replace capcolor = "buff" if capcolor == "b"}{break} {space 4}{inp:. replace capcolor = "cinnamon" if capcolor == "c"}{break} {space 4}{inp:. replace capcolor = "gray" if capcolor == "g"}{break} {space 4}{inp:. replace capcolor = "green" if capcolor == "r"}{break} {space 4}{inp:. replace capcolor = "pink" if capcolor == "p"}{break} {space 4}{inp:. replace capcolor = "purple" if capcolor == "u"}{break} {space 4}{inp:. replace capcolor = "red" if capcolor == "e"}{break} {space 4}{inp:. replace capcolor = "white" if capcolor == "w"}{break} {space 4}{inp:. replace capcolor = "yellow" if capcolor == "y"}{break} {space 4}{inp:. rename capcolor capcolor2}{break} {space 4}{inp:. encode capcolor2, generate(capcolor)}{break} {space 4}{inp:. drop capcolor2}{break} {space 4}{inp:. label variable capcolor "cap color"}{break} {space 4}{inp:. }{break} {space 4}{inp:. generate byte bruises2 = 1 if bruises == "t"}{break} {space 4}{inp:. replace bruises2 = 0 if bruises == "f"}{break} {space 4}{inp:. label define bruises 0 "no bruises" 1 "bruises"}{break} {space 4}{inp:. drop bruises}{break} {space 4}{inp:. rename bruises2 bruises}{break} {space 4}{inp:. label values bruises bruises}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace odor = "almond" if odor == "a"}{break} {space 4}{inp:. replace odor = "anise" if odor == "l"}{break} {space 4}{inp:. replace odor = "creosote" if odor == "c"}{break} {space 4}{inp:. replace odor = "fishy" if odor == "y"}{break} {space 4}{inp:. replace odor = "foul" if odor == "f"}{break} {space 4}{inp:. replace odor = "musty" if odor == "m"}{break} {space 4}{inp:. replace odor = "none" if odor == "n"}{break} {space 4}{inp:. replace odor = "pungent" if odor == "p"}{break} {space 4}{inp:. replace odor = "spicy" if odor == "s"}{break} {space 4}{inp:. rename odor odor2}{break} {space 4}{inp:. encode odor2, generate(odor)}{break} {space 4}{inp:. drop odor2}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace gillattach = "attached" if gillattach == "a"}{break} {space 4}{inp:. replace gillattach = "descending" if gillattach == "d"}{break} {space 4}{inp:. replace gillattach = "free" if gillattach == "f"}{break} {space 4}{inp:. replace gillattach = "notched" if gillattach == "n"}{break} {space 4}{inp:. rename gillattach gillattach2}{break} {space 4}{inp:. encode gillattach2, generate(gillattach)}{break} {space 4}{inp:. drop gillattach2}{break} {space 4}{inp:. label variable gillattach "gill attachment"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace gillspace = "close" if gillspace == "c"}{break} {space 4}{inp:. replace gillspace = "crowded" if gillspace == "w"}{break} {space 4}{inp:. replace gillspace = "distant" if gillspace == "d"}{break} {space 4}{inp:. rename gillspace gillspace2}{break} {space 4}{inp:. encode gillspace2, generate(gillspacing)}{break} {space 4}{inp:. drop gillspace2}{break} {space 4}{inp:. label variable gillspacing "gill spacing"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace gillsize = "broad" if gillsize == "b"}{break} {space 4}{inp:. replace gillsize = "narrow" if gillsize == "n"}{break} {space 4}{inp:. rename gillsize gillsize2}{break} {space 4}{inp:. encode gillsize2, generate(gillsize)}{break} {space 4}{inp:. drop gillsize2}{break} {space 4}{inp:. label variable gillsize "gill size"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace gillcolor = "black" if gillcolor == "k"}{break} {space 4}{inp:. replace gillcolor = "brown" if gillcolor == "n"}{break} {space 4}{inp:. replace gillcolor = "buff" if gillcolor == "b"}{break} {space 4}{inp:. replace gillcolor = "chocolate" if gillcolor == "h"}{break} {space 4}{inp:. replace gillcolor = "gray" if gillcolor == "g"}{break} {space 4}{inp:. replace gillcolor = "green" if gillcolor == "r"}{break} {space 4}{inp:. replace gillcolor = "orange" if gillcolor == "o"}{break} {space 4}{inp:. replace gillcolor = "pink" if gillcolor == "p"}{break} {space 4}{inp:. replace gillcolor = "purple" if gillcolor == "u"}{break} {space 4}{inp:. replace gillcolor = "red" if gillcolor == "e"}{break} {space 4}{inp:. replace gillcolor = "white" if gillcolor == "w"}{break} {space 4}{inp:. replace gillcolor = "yellow" if gillcolor == "y"}{break} {space 4}{inp:. rename gillcolor gillcolor2}{break} {space 4}{inp:. encode gillcolor2, generate(gillcolor)}{break} {space 4}{inp:. drop gillcolor2}{break} {space 4}{inp:. label variable gillcolor "gill color"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace stalkshape = "enlarging" if stalkshape == "e"}{break} {space 4}{inp:. replace stalkshape = "tapering" if stalkshape == "t"}{break} {space 4}{inp:. rename stalkshape stalkshape2}{break} {space 4}{inp:. encode stalkshape2, generate(stalkshape)}{break} {space 4}{inp:. drop stalkshape2}{break} {space 4}{inp:. label variable stalkshape "stalk shape"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace stalkroot = "bulbous" if stalkroot == "b"}{break} {space 4}{inp:. replace stalkroot = "club" if stalkroot == "c"}{break} {space 4}{inp:. replace stalkroot = "cup" if stalkroot == "u"}{break} {space 4}{inp:. replace stalkroot = "equal" if stalkroot == "e"}{break} {space 4}{inp:. replace stalkroot = "rhizomorphs" if stalkroot == "z"}{break} {space 4}{inp:. replace stalkroot = "rooted" if stalkroot == "r"}{break} {space 4}{inp:. replace stalkroot = "missing" if stalkroot == "?"}{break} {space 4}{inp:. rename stalkroot stalkroot2}{break} {space 4}{inp:. encode stalkroot2, generate(stalkroot)}{break} {space 4}{inp:. drop stalkroot2}{break} {space 4}{inp:. label variable stalkroot "stalk root"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace stalksurfabovering = "fibrous" if stalksurfabovering == "f"}{break} {space 4}{inp:. replace stalksurfabovering = "scaly" if stalksurfabovering == "y"}{break} {space 4}{inp:. replace stalksurfabovering = "silky" if stalksurfabovering == "k"}{break} {space 4}{inp:. replace stalksurfabovering = "smooth" if stalksurfabovering == "s"}{break} {space 4}{inp:. encode stalksurfabovering, generate(stalkA)}{break} {space 4}{inp:. drop stalksurfabovering}{break} {space 4}{inp:. label variable stalkA "stalk surface above ring"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace stalksurfbelowring = "fibrous" if stalksurfbelowring == "f"}{break} {space 4}{inp:. replace stalksurfbelowring = "scaly" if stalksurfbelowring == "y"}{break} {space 4}{inp:. replace stalksurfbelowring = "silky" if stalksurfbelowring == "k"}{break} {space 4}{inp:. replace stalksurfbelowring = "smooth" if stalksurfbelowring == "s"}{break} {space 4}{inp:. encode stalksurfbelowring, generate(stalkB)}{break} {space 4}{inp:. drop stalksurfbelowring}{break} {space 4}{inp:. label variable stalkB "stalk surface below ring"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace stalkcolorabove = "brown" if stalkcolorabove == "n"}{break} {space 4}{inp:. replace stalkcolorabove = "buff" if stalkcolorabove == "b"}{break} {space 4}{inp:. replace stalkcolorabove = "cinnamon" if stalkcolorabove == "c"}{break} {space 4}{inp:. replace stalkcolorabove = "chocolate" if stalkcolorabove == "h"}{break} {space 4}{inp:. replace stalkcolorabove = "gray" if stalkcolorabove == "g"}{break} {space 4}{inp:. replace stalkcolorabove = "orange" if stalkcolorabove == "o"}{break} {space 4}{inp:. replace stalkcolorabove = "pink" if stalkcolorabove == "p"}{break} {space 4}{inp:. replace stalkcolorabove = "red" if stalkcolorabove == "e"}{break} {space 4}{inp:. replace stalkcolorabove = "white" if stalkcolorabove == "w"}{break} {space 4}{inp:. replace stalkcolorabove = "yellow" if stalkcolorabove == "y"}{break} {space 4}{inp:. encode stalkcolorabove, generate(stalkcolorA)}{break} {space 4}{inp:. drop stalkcolorabove}{break} {space 4}{inp:. label variable stalkcolorA "stalk color above ring"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace stalkcolorbelow = "brown" if stalkcolorbelow == "n"}{break} {space 4}{inp:. replace stalkcolorbelow = "buff" if stalkcolorbelow == "b"}{break} {space 4}{inp:. replace stalkcolorbelow = "cinnamon" if stalkcolorbelow == "c"}{break} {space 4}{inp:. replace stalkcolorbelow = "chocolate" if stalkcolorbelow == "h"}{break} {space 4}{inp:. replace stalkcolorbelow = "gray" if stalkcolorbelow == "g"}{break} {space 4}{inp:. replace stalkcolorbelow = "orange" if stalkcolorbelow == "o"}{break} {space 4}{inp:. replace stalkcolorbelow = "pink" if stalkcolorbelow == "p"}{break} {space 4}{inp:. replace stalkcolorbelow = "red" if stalkcolorbelow == "e"}{break} {space 4}{inp:. replace stalkcolorbelow = "white" if stalkcolorbelow == "w"}{break} {space 4}{inp:. replace stalkcolorbelow = "yellow" if stalkcolorbelow == "y"}{break} {space 4}{inp:. encode stalkcolorbelow, generate(stalkcolorB)}{break} {space 4}{inp:. drop stalkcolorbelow}{break} {space 4}{inp:. label variable stalkcolorB "stalk color below ring"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace veiltype = "partial" if veiltype == "p"}{break} {space 4}{inp:. replace veiltype = "universal" if veiltype == "u"}{break} {space 4}{inp:. rename veiltype veiltype2}{break} {space 4}{inp:. encode veiltype2, generate(veiltype)}{break} {space 4}{inp:. drop veiltype2}{break} {space 4}{inp:. label variable veiltype "veil type"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace veilcolor = "brown" if veilcolor == "n"}{break} {space 4}{inp:. replace veilcolor = "orange" if veilcolor == "o"}{break} {space 4}{inp:. replace veilcolor = "white" if veilcolor == "w"}{break} {space 4}{inp:. replace veilcolor = "yellow" if veilcolor == "y"}{break} {space 4}{inp:. rename veilcolor veilcolor2}{break} {space 4}{inp:. encode veilcolor2, generate(veilcolor)}{break} {space 4}{inp:. drop veilcolor2}{break} {space 4}{inp:. label variable veilcolor "veil color"}{break} {space 4}{inp:. }{break} {space 4}{inp:. generate byte ringnumb2 = 0 if ringnumb == "n"}{break} {space 4}{inp:. replace ringnumb2 = 1 if ringnumb == "o"}{break} {space 4}{inp:. replace ringnumb2 = 2 if ringnumb == "t"}{break} {space 4}{inp:. drop ringnumb}{break} {space 4}{inp:. rename ringnumb2 ringnumber}{break} {space 4}{inp:. label variable ringnumber "ring number"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace ringtype = "cobwebby" if ringtype == "c"}{break} {space 4}{inp:. replace ringtype = "evanescent" if ringtype == "e"}{break} {space 4}{inp:. replace ringtype = "flaring" if ringtype == "f"}{break} {space 4}{inp:. replace ringtype = "large" if ringtype == "l"}{break} {space 4}{inp:. replace ringtype = "none" if ringtype == "n"}{break} {space 4}{inp:. replace ringtype = "pendant" if ringtype == "p"}{break} {space 4}{inp:. replace ringtype = "sheathing" if ringtype == "s"}{break} {space 4}{inp:. replace ringtype = "zone" if ringtype == "z"}{break} {space 4}{inp:. rename ringtype ringtype2}{break} {space 4}{inp:. encode ringtype2, generate(ringtype)}{break} {space 4}{inp:. label variable ringtype "ring type"}{break} {space 4}{inp:. drop ringtype2}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace sporecolor = "black" if sporecolor == "k"}{break} {space 4}{inp:. replace sporecolor = "brown" if sporecolor == "n"}{break} {space 4}{inp:. replace sporecolor = "buff" if sporecolor == "b"}{break} {space 4}{inp:. replace sporecolor = "chocolate" if sporecolor == "h"}{break} {space 4}{inp:. replace sporecolor = "green" if sporecolor == "r"}{break} {space 4}{inp:. replace sporecolor = "orange" if sporecolor == "o"}{break} {space 4}{inp:. replace sporecolor = "purple" if sporecolor == "u"}{break} {space 4}{inp:. replace sporecolor = "white" if sporecolor == "w"}{break} {space 4}{inp:. replace sporecolor = "yellow" if sporecolor == "y"}{break} {space 4}{inp:. rename sporecolor sporecolor2}{break} {space 4}{inp:. encode sporecolor2, generate(sporecolor)}{break} {space 4}{inp:. drop sporecolor2}{break} {space 4}{inp:. label variable sporecolor "spore print color"}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace population = "abundant" if population == "a"}{break} {space 4}{inp:. replace population = "clustered" if population == "c"}{break} {space 4}{inp:. replace population = "numerous" if population == "n"}{break} {space 4}{inp:. replace population = "scattered" if population == "s"}{break} {space 4}{inp:. replace population = "several" if population == "v"}{break} {space 4}{inp:. replace population = "solitary" if population == "y"}{break} {space 4}{inp:. rename population population2}{break} {space 4}{inp:. encode population2, generate(population)}{break} {space 4}{inp:. drop population2}{break} {space 4}{inp:. }{break} {space 4}{inp:. replace habitat = "grasses" if habitat == "g"}{break} {space 4}{inp:. replace habitat = "leaves" if habitat == "l"}{break} {space 4}{inp:. replace habitat = "meadows" if habitat == "m"}{break} {space 4}{inp:. replace habitat = "paths" if habitat == "p"}{break} {space 4}{inp:. replace habitat = "urban" if habitat == "u"}{break} {space 4}{inp:. replace habitat = "waste" if habitat == "w"}{break} {space 4}{inp:. replace habitat = "woods" if habitat == "d"}{break} {space 4}{inp:. rename habitat habitat2}{break} {space 4}{inp:. encode habitat2, generate(habitat)}{break} {space 4}{inp:. drop habitat2}{break} {space 4}{inp:. compress}{break} {space 4}{inp:. label data "Lincoff (1981) Audubon Guide;  http://www.ics.uci.edu/~mlearn/databases/mushroom/"}{break} Then attaching these notes and saving the dataset.
To create the reduced dataset the following commands were used: {break} {space 4}{inp:. local varlist population habitat bruises capshape capsurface capcolor}{break} {space 4}{inp:. foreach v of local varlist {c -(}}{break} {space 4}{inp:.{space 4}qui levelsof {c 'g}v'}{break} {space 4}{inp:.{space 4}local levels {c 'g}r(levels)'}{break} {space 4}{inp:.{space 4}foreach value of local levels {c -(}}{break} {space 4}{inp:.{space 8}qui count if {c 'g}v' == {c 'g}value'}{break} {space 4}{inp:.{space 8}local tot = r(N)}{break} {space 4}{inp:.{space 8}qui count if {c 'g}v' == {c 'g}value' & poison==0}{break} {space 4}{inp:.{space 8}if r(N) == 0 | r(N) == {c 'g}tot' {c -(}}{break} {space 4}{inp:.{space 12}qui drop if {c 'g}v'=={c 'g}value'}{break} {space 4}{inp:.{space 8}        {c )-}}{break} {space 4}{inp:.{space 4}{c )-}}{break} {space 4}{inp:. {c )-}}{break} Then attaching this note and saving the dataset.