510 likes | 1.31k Views
Introduction. This introduction is a complement to exsysCORVID_QuickStartGuide.pdfI hope this introduction will provide you with useful information in developing several expert systems.Exsys CORVID is an Expert System Shell or Artificial Intelligence Shell, the programming environment of an expe
E N D
1. Expert System Development with Corvid MI375
2. Introduction This introduction is a complement to exsysCORVID_QuickStartGuide.pdf
I hope this introduction will provide you with useful information in developing several expert systems.
Exsys CORVID is an Expert System Shell or Artificial Intelligence Shell, the programming environment of an expert system.
3. What To Do ES rules—Suppose you are given the following two sets of rules to build expert systems.
4. “Buy House” ES Rules
5. How to develop ES with Corvid Before you start with Corvid EXSYS, there are some preliminary works to do.
1. Identify confidence variables
Confidence variables are the possible options/ decision/action alternatives.Rule base in what to do ES contains 4 confidence variables.They are “go to the golf course”, “go to the ski resort”, “go to work”, “go to class”
6. 2. Identify Static List Variables
This is a multiple choice list
What are static list variables in the what to do ES rule base?
There are two – weather and season
What are the values associated with each static variable?
Weather has two text values – “nice day” and “not nice day”
season has two text values – “summer” and “winter”
You will see many other variable types in CORVID. However, the variables that are not discussed here will not be used in the assignment.
7. 3. Identify Numeric Variables if Any
In our rule bases, there are no numeric variables.
Numeric variables are to be used when the possible values cover a wide range of numeric values. If there are only a few possible values, it is generally better to use a static list variable.
8. Logic Tree, Logic Block 4. Draw Logic Tree and Logic Block Diagram
Unlike any other expert system shell program, Corvid Exsys is based on the concept of Logic Block.
The logic block in Corvid is a way of logically organizing the rules to increase efficiency in ES development.
9. How to build a logic tree The first variable in the what to do ES rules is weather, which has two values – a nice day and not a nice day. Thus, the logic tree is constructed as below.
Weather = Nice dayWeather = Not a nice day
10. IF Part The second variable in the rule is season, which has two values – summer and winter. Thus, the logic tree is further expanded as below. This part of tree represents all possible if part of the rules in the system. Notice that the second line of IF part (season=summer) is indented, which means both nodes must be true.
Weather = Nice day season = summer season = winter Weather = Not a nice day season = summer season = winter
11. THEN Part Once we identified all IF part of the rules, we need to add THEN part of the rules. Let’s consider how to construct the THEN part of the first rule: “IF it is a nice day AND it is summer, THEN I go to the golf course”. The arrow and bracket indicates the THEN part of the rule.
Weather = Nice day season = summer -? [the golf course] = 100 season = winter Weather = Not a nice day season = summer season = winter
12. Let’s add the second rule to the logic block– “IF it is a nice day AND it is winter, THEN I go to the ski resort.”
Weather = Nice day season = summer -? [the golf course] = 100 season = winter -? [the ski resort] = 100 Weather = Not a nice day season = summer season = winter
13. Let’s add all other rules to the logic block. Weather = Nice day season = summer -? [the golf course] = 100 season = winter -? [the ski resort] = 100 Weather = Not a nice day season = summer -? [work] = 100 season = winter -? [class] = 100
14. Nodes, rules, logic blocks An ES consists of Logic Blocks.
A logic block consists of rules.
A rule consists of nodes.
A node is a statement in the IF or THEN part of a rule.
15. “IF it is a nice day AND it is summer, THEN I go to the golf course.”
Number of nodes --- 3 (2 if nodes and 1 then node.
Number of rules --- 1
What-to-do ES (slide 13) has:
1 logic block
4 rules
16. Building an Expert System with CORVID The following section demonstrates how to build an expert system with CORVID.
There are several building steps
Define variables and their values and construct a decision tree and/or logic block
Enter the variables
Enter the rules using LOGIC BLOCKS
Enter the command using COMMAND BLOCKS
17. Define variables and their values and construct a decision tree and/or logic block
These steps are already explained in the previous steps.
Enter the variables
This step is the first step with opened CORVID program.
The next slide shows each step.
18. Building ES with Corvid Start -? all programs ? Exsys ? Corvid ? Corvid? OK
19. Enter the file name to savethe expert system I am building is “What_to_do”
20. Now follow the steps from p.7 of the EXSYS Getting started quick guide
21. Creating list variables:in the earlier discussion, we identified weather and season . The following show how to create the first variable- weather
22. Prompt: The prompt is the message you will see when running the expert system. Therefore, you enter appropriate phrase as shown below.
23. Enter the values associated with each variable
24. Creating confidence variables: Unlike static variables, confidence variables must be indicated by checking the proper box.
25. Entering Rules using Logic Blocks:the next step after variable creation is adding rules by clicking the logic block icon with green color L button on the top left of the window and click “add” button at bottom left
26. This is what you see!
27. To build the first rule, we need to use the weather variable. To do so, click the weather variable.
28. This screen shows that you chose nice day
29. The screen below shows that you entered two IF conditions.
30. To complete the first rule, you need to add THEN part of the rule
31. This is the logic block after completing rule 1. The reason I captured this screen is to show you that to enter the second rule it is important for you build the second rule at the same level below. Therefore before proceeding the next, you MUST click the “below” burton under same level.
32. This is to build the second rule IF part.
33. You will notice that all confidence variables should be assigned confidence levels. In this exercise and assignment, use all 100.
34. The same emphasis: To build the last rule you have to click “Below” Button under same level.
35. Completion of all 4 rules
36. After completion, here is the LB
37. Corvid Command Blocks The last step of building an expert system is completing command blocks
38. To start a command block, select “Command Block” by Clicking Command Block Icon. Then click “add” button.
39. This is the command window for building commands
40. This assignment needs the following: click derive the value .. and “ all confidence variables” radio button.
41. After that, you will see the below. Then click the “add below” button.
42. The last action is clicking the “Display Default Result Screen” radio button. You are done. Your system is ready to be tested.
43. How do we decide the number of logic block? 1 Logic Block contains only one group of IF statements and then statements.
1 Logic block does NOT contain if statement, derived from an THEN or ELSE statement from other rules.
In other words, the purpose of having more than 1 logic block is that the second logic block starts with if statement derived from the conclusion of the first logic block.
44. An example of rules that can NOT be a logic block IF inflation is lowTHEN interest rates are lowELSE interest rates are high
IF interests are highTHEN housing prices are high
IF housing prices are high THEN Do not buy a houseELSE Buy it
The above example shows that since rules #2, #3 have IF statement that is the same as either THEN or ELSE statement in other rule(s), it cannot be one logic block. There should be three logic blocks.
45. Drawing a decision tree: An example The data contents in this example do not reflect any of my personal views in any way. It is purely hypothetical non-sense data.
46. Decision(logic) tree and Logic Block The Decision tree is drawn by you. The two terms often used interchangeably. They help you to systematically organize data.
The logic block is constructed by Corvid, based on your rules added to the knowledge base. The knowledge base is a component of an expert system that holds all the rules you have added.
47. The Corvid program is called AI (artificial intelligence) shell or expert system (ES) shell. The term shell refers to the computer program, not the shell that can be found on the Pesacola beach.
The following slides demonstrate that an expert system can be built from a given transaction data.
By observing the data, YOU construct a decision tree.
The decision tree you built is a blueprint that guides you to build an expert system via a logic block.
48. ES data
49. Decision Tree drawn from data
50. Decision tree Oval shape represents decision variables
Rectangle represents confidence variables
Straight lines represent values of decision variables
51. Numeric variables The credit granting expert system (this week’s assignment) uses many numeric variables.
In CORVID, expressions can include the value of any numerical variable by putting the name of variable in double brackets [ ]. CORVID supports standard algebraic operators. Suppose we have a rule that says IF debt ratio is greater than 30%, THEN deny the loan. Using the numerical variables, the rule can be written as:
( IF) [card_balance]/[annual_income]< .3
(THEN) Do Not Grant Credit.
Using an example from the assignment, if income is less than $50,000 and Car Payment is greater than 10% of your income then do not grant credit. This can be written as:
, (IF) [INCOME] >= 500000
[car_payment] >= [INCOME]*.10
(THEN) Do Not Grant Credit.