ICS 171 Homework #17

1. (100) Run the rule learning program on 15 people from the file lenses.lisp to create rules that predict what type of contacts lenses people should wear. Choose 8 people with no lenses, 3 with hard and 4 with soft. Evaluate the rules learned on all examples.

(load "unify")
(load "fast-traced-prove")
(load "lenses")  
(store-clauses *lenses*) 
(load "learn")

(defparameter *soft-subset* <insert a quoted list of any four people from 3 5 12 13 20>)
(defparameter *hard-subset* <insert a quoted list of any three people from 2 10 16 18>)
(defparameter *no-subset* <insert a quoted list of any eight people from 1 4 6 7 8 9 11 14 15 17 19 21 22 23 24>)

(setq *no-rules* (learn-clauses *no-subset* 
                               (append *soft-subset* *hard-subset*) 
                               '(lenses ?p no)))

(setq *hard-rules* (learn-clauses *hard-subset* 
                                  (append *soft-subset* *no-subset*)
                                  '(lenses ?p hard)))

(setq *soft-rules* (learn-clauses *soft-subset* 
                                  (append *no-subset* *hard-subset*)
                                   *lenses-predicates* '
                                  (lenses ?p soft)))

(defparameter *all-rules* (append *soft-rules* *hard-rules* *no-rules*))

(store-clauses *all-rules*)

(test-rules 'lenses 'correct-diagnosis)
Repeat above procedure again with different combination of people who wears *no-lenses*, *soft-lenses*, *hard-lenses*. And see if the learned rule and accuracy is different.
Back to http://www.ics.uci.edu/~pazzani/171-p.html (text only) or http://www.ics.uci.edu/~pazzani/171.html .

Michael Pazzani
Department of Information and Computer Science,
University of California, Irvine
Irvine, CA 92717-3425