


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Instructions for university students enrolled in comp151 spring 2007 course on using the lisp code supplied for the aima textbook to create and use decision trees and neural networks for solving learning problems. Installation and setup instructions, examples of defining a learning problem, creating and using decision trees, and creating, training, and using neural networks. Students are expected to configure their systems, load the aima code, and use the provided examples to understand the concepts.
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!
For this assignment you will create and compare learning agents. The current document contains instructions on using the Lisp code supplied for the AIMA textbook to create and use decision trees and neural networks. The details of the assignment will be posted shortly. In the meantime, begin by getting your system configured and tested using some of the supplied example problems.
Download and install a Lisp interpreter (do once): A good free implementation of Common Lisp is Allegro CL 8.0 Free Express Edition, available at http://www.franz.com/downloads/. Many other Lisp interpreters are available, some are listed here: http://www.thefreecountry.com/compilers/commonlisp.shtml. Downloading and initializing AIMA code (do once): The full package of AIMA Lisp codes is available at http://aima.cs.berkeley.edu/lisp/doc/overview.html. If you are using Allegro CL from Franz Inc., be sure to get the code linked to from the third bullet, which leads to ftp://ftp.franz.com/pub/aima/code/tar.gz. Unpack the code into a convenient directory, such as C:/aima. Edit the file aima.lisp, which is in the root of the directory in which you unpacked the AIMA code. Modify the value of the parameter aima-root to match your AIMA directory. Loading AIMA code for learning problems (every time you restart Lisp): Start your Lisp interpreter and execute the following commands to load the AIMA code: CG-USER(2): (load "C:\aima\aima.lisp") CG-USER(3): (aima-load 'learning) The first line should be modified to match your AIMA installation directory.
Defining a learning problem: The learning algorithms expect problems to be defined as learning-problem structures. Here’s an example of a properly defined problem: The AIMA code has a number of problems pre-defined. Some of them are: majority-boolean-problem restaurant-boolean-problem restaurant-multivalued-problem restaurant-real12-problem restaurant-real100-problem The asterisks are part of the name. The last one is the source of the restaurant data that we were using in class. You can also define a problem structure using the more familiar forms for setting structure fields: (setq and-problem (make-learning-problem :attributes '((A1 0 1) (A2 0 1)) :goals '((G1 0 1)) :examples '( ((G1. 0) (A1. 0) (A2. 0)) ((G1. 0) (A1. 0) (A2. 1)) ((G1. 0) (A1. 1) (A2. 0)) ((G1. 1) (A1. 1) (A2. 1)) ))) (setq and-problem (make-learning-problem)) (setf (learning-problem-examples and-problem)'( ((G1. 0) (A1. 0) (A2. 0)) ((G1. 0) (A1. 0) (A2. 1)) ((G1. 0) (A1. 1) (A2. 0)) ((G1. 1) (A1. 1) (A2. 1)) )) (setf (learning-problem-attributes and-problem) '((A1 0 1) (A2 0 1))) (setf (learning-problem-goals and-problem) '((G1 0 1)))
Loading and running data sets from files: The data subdirectory of the supplied code contains five data sets in text format. These data sets can be loaded into a format compatible with the AIMA code through the functions defined in readdatafile.lisp and createproblem.lisp. The file load-a6.lisp is the main program for loading all necessary code. You will need to modify this file depending on where you locate your code. Once you’ve successfully loaded the code and problem sets, look at the files run-*.lisp for examples of how to train and test a neural net on a specific problem. You assignment will be based on the restaurant data set, so you should make sure that you can understand and run the file run-restaurant.lisp.