;;; ;;; Tool For Reading Decision Tree Data Files ;;; ;;; Directly including the data files for this inductive learning ;;; assignment into your Lisp code will produce some giant source ;;; code files. Instead of directly including the data, you should ;;; read the data files from the "public" directory at run time. ;;; The function below will help you do this. ;;; ;;; The function simply takes a file name (along with a path) as an ;;; input argument, reads a single tree of CONS cells from the given ;;; file, and returns the tree. You should be able to use this ;;; function to read both the attribute lists and the actual labeled ;;; instances. ;;; ;;; DAVID NOELLE Tue May 28 11:59:25 1996 ;;; ;;; ;;; Package ;;; (cl::in-package "COMMON-LISP-USER") ;;; ;;; Read Tree From File ;;; (defun read-tree-from-file (filename) (declare (type string filename)) (with-open-file (stream filename :direction :input) (read stream)))