;;;; Author: Steve Wolfman ;;;; ;;;; This constructs a set of data points and (dummy) features ;;;; for the mushroom domain. Note that there is no way to ;;;; actually calculate the features; they must be hardcoded ;;;; in the data points. ;;;; ;;;; The data points are taken from CSE473's class slides ('99 ;;;; winter at the U of Washington). The decision tree built ;;;; from this should just check for spots. Try removing the ;;;; spots feature and see what happens: ;;;; ;;;; (learn *data* (remove :SPOTS *features* :key #'feature-name) :EDIBLE NIL) ;;;; ;;;; Also, try just allowing the :COLOR feature. Note that this is ;;;; a nice small domain to test your guesses! With just :COLOR, ;;;; :BROWN is ambiguous; with :COLOR and :SPORES, there's no data ;;;; for :RED, and :BROWN with spores is evenly divided (so it should ;;;; use the guess _you_ pass in!). ;; Mushroom feature list (no extractors!) (defparameter *features* '((:SPORES "Does the mushroom have spores?" (:Y :N) NIL) (:SPOTS "Does the mushroom have spots?" (:Y :N) NIL) (:COLOR "What color is the mushroom?" (:BROWN :GREY :BLACK :WHITE :RED) NIL))) ;; 6 data points for the mushroom domain. The target attribute should be ;; :edible. Your default guess should be NIL! (defparameter *data* '(((:SPORES . :Y) (:SPOTS . :N) (:COLOR . :BROWN) (:EDIBLE . NIL)) ((:SPORES . :Y) (:SPOTS . :Y) (:COLOR . :GREY) (:EDIBLE . T)) ((:SPORES . :N) (:SPOTS . :Y) (:COLOR . :BLACK) (:EDIBLE . T)) ((:SPORES . :N) (:SPOTS . :N) (:COLOR . :BROWN) (:EDIBLE . NIL)) ((:SPORES . :Y) (:SPOTS . :N) (:COLOR . :WHITE) (:EDIBLE . NIL)) ((:SPORES . :Y) (:SPOTS . :Y) (:COLOR . :BROWN) (:EDIBLE . T))))