chickadee » dataset-utils » make-relation

make-relation name attributes dataprocedure

Creates a relation with given name. The attributes must be a list of attribute instances, and the data are a list of lists: each sublist representing an instance, and giving the value for that instance of every attribute.

> (make-relation 'plays-tennis
                  (list (make-nominal-attribute 'outlook 'sunny 'overcast 'rainy)
                        (make-nominal-attribute 'temperature 'hot 'mild 'cool)
                        (make-nominal-attribute 'humidity 'high 'normal)
                        (make-nominal-attribute 'windy 'true 'false)
                        (make-nominal-attribute 'plays 'yes 'no))
                  '((sunny hot high false no)
                    (sunny hot high true no)
                    (overcast hot high false yes)
                    ...
                    (rainy mild high true no)))