CSE255 THURSDAY JANUARY 29, 1998 RESULTS OF THE FIRST PROJECT Team scores ranged from 8 to 17 out of 20. THREE POINTS OFF Plagiarism. Not analyzing why 98% of test examples are predicted to be positive. TWO POINTS OFF No analysis of why accuracy is worse than base rate. No discussion of profits in addition to accuracy. Not understanding that 83% is a probability threshold for each individual test example. Repeated database querying to compute counts, which loses linear time complexity. ONE POINT OFF Accuracy supposedly peaking with 500 training examples. No explanation of the real-world implications of cost and accuracy results on the 200 test examples. Using costs that are not flows of cash. Wrong threshold for making decisions. Systematically misplaced commas. Indistinguishable lines in graphs. Not citing references in the text where they are used or relevant. Ridiculously optimistic self-evaluations. NO POINTS OFF Unmotivated choice of numbers of bins for quantization. Incorrect mathematical statements about the naive Bayesian equations. Using an obsolete programming environment. Duplication in code. Generic paper and section titles. Irrelevant sections. Incorrect terminology, e.g. cross-correlation for cross-validation. Amateurish mathematical formatting. Ending a page with the title of the next section. Using slashes as punctuation symbols. Binders that look good but fall apart. FEATURES OF CLIPS 6.0 CLIPS stands for "C Language Integrated Production System." CLIPS 6.0 supports three types of programming. Rule-based programming uses rules of the form "if condition is true then perform action" Object-oriented programming states knowledge about properties of entities in the environment in a modular way. Imperative programming (also called procedural) gives sequences of instructions as in C, Ada, Lisp, and all other standard languages. THE FACT-LIST The internal database is called the fact-list. Facts in the fact-list stimulate the execution of rules. CLIPS> (assert (hunting-season)) this is the response Fact-0 is the name of the zeroth item in the fact-list. CLIPS uses Lisp syntax, i.e. "Lots of Infernal Silly Parentheses". The general syntax is (function-name list of arguments) Built-in commands are functions, some with no arguments, e.g. (exit) which quits CLIPS (facts) which yields f-0 (duck) (clear) (reset) like (clear) except one initial fact is asserted Normally every fact in the fact-list must be different. CLIPS is case-sensitive and has special characters that should be avoided. A semi-colon starts a comment. USING FACTS TO REPRESENT KNOWLEDGE Most facts are structured: the first field names a relationship later fields name the entities that have this relationship Example: (hunts Brian Tweety) Relationships often correspond to English verbs. Order is important among arguments. A standard convention is that the subject is the first argument. Some relationships have no arguments, e.g. (hunting-season). A "symbol" in CLIPS is an identifier that is the name of something. A string is different, and is always in quotes. Fields can be symbols or strings or numbers. ASSERTING AND RETRACTING The typical action performed by a rule is to assert or retract a fact: CLIPS> (watch facts) monitor assertions and retractions CLIPS> (retract 0) give the fact index to retract it <== f-0 (hunting-season) a retraction happened DEFINING RULES The defrule command enters a rule into the knowledge base. (defrule duck-sound (animal-is duck) => (assert (sound-is quack))) The name of this rule is duck-sound. The left-hand-side is one or more patterns. The right-hand-side is one or more actions. USING RULES If all the patterns of a rule match facts in the fact-list, then the rule is activated, meaning it is placed on the agenda. The highest priority activated rule is fired, meaning its actions are executed. This typically adds or deletes facts, which means new rules are activated or deactivated. The new highest priority activated rule is then fired. And so on. The command (agenda) tells you what's on the agenda. (run) starts the rules firing (save "filename") saves all entered rules in a file FORWARD-CHAINING AND DIAGNOSIS So-called "forward chaining" is one type of rule-based reasoning. Under forward chaining, rules are repeatedly triggered by facts and add new facts to the fact-list, i.e. working memory. Forward-chaining is useful for solving simple diagnosis problems. The initial facts in the fact-list are the premises of the problem to be solved, e.g. visible symptoms. Rules add new conclusions until they reach solutions, e.g. a diagnosis. Then further rules can start from the diagnosis, and add more conclusions, finally reaching recommended actions.