home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / INDUCE.ZIP / INDUCE.DOC < prev    next >
Encoding:
Text File  |  1986-06-04  |  8.5 KB  |  231 lines

  1.                                  INDUCE
  2.  
  3.  
  4.                   Copyright 1986 - MicroExpert Systems
  5.                              Box 430 R.D. 2
  6.                             Nassau, NY 12123
  7.  
  8.  
  9.      INDUCE implements the ID3 algorithm for the generation of rules from 
  10. a  data   set to be described (we hope) in the article "Finding Knowledge 
  11. in  Data"  in  the November 1986 issue of BYTE.  For details on  the  ID3 
  12. algorithm  see Quinlan's article in Machine Intelligence,  An  Artificial 
  13. Intelligence Approach edited by Micalski,  Carbonell and Mitchell.  It is 
  14. published by Tioga Publishing Co., Palo Alto CA, 1983.
  15.  
  16.     The  program has been tested using Turbo Version 3.01A on an IBM  PC. 
  17. It  has been run under both DOS 2.1 and Concurrent 4.1 .  The source  for 
  18. this program is contained in two files,  INDUCE.PAS and   INDUCE.INC. The 
  19. program produces one overlay file INDUCE.000 .
  20.  
  21.      INDUCE produces a knowledge base which can be used with MicroExpert.   
  22. MicroExpert is an expert system shell written in Turbo Pascal for the IBM 
  23. PC  and  Apple  II.  It is available for $49.95 and comes  with  complete 
  24. source code. It can be order by writing to :
  25.  
  26.         McGraw-Hill Book Company
  27.         P.O. Box 400
  28.         Hightstown, NJ 08520
  29.  
  30.    Or calling 1-800-628-004 or in New York state 212/512-2999.
  31.  
  32.    We  would  be  pleased to hear your comments,  good  or  bad,  or  any 
  33. applications   and modifications of the program.  Contact us at the above 
  34. address  or on BIX.  Our id is bbt and we may be contacted via BIXmail or 
  35. by leaving comments in the MicroExpert conference.
  36.  
  37. -   Bill and Bev Thompson 
  38.  
  39.  
  40.                                 Operation
  41.  
  42.      To  start  the  program simply switch to  the  directory  containing 
  43. INDUCE.COM and INDUCE.000 and at the DOS prompt type INDUCE and press the 
  44. ENTER key. The screen will clear and the message
  45.  
  46. Example File (Press <ENTER> to quit.) : 
  47.  
  48. will  appear.  Type in the name of your example file and press the  enter 
  49. key.  The  file name should include the drive and path name if necessary. 
  50. The  default extension for example files is ".EX".  The program will  now 
  51. read  the example file.  Error messages will be displayed on the  screen. 
  52. The  program  does not do very extensive error checking,  so be  sure  to 
  53. examine  the example files and knowledge base to be sure that  they  make 
  54. sense.
  55.  
  56.      Once  the file has been read,  the program will attempt to  classify 
  57. the example set.  Each time an attempt is made to classify a partition of 
  58. the  example  set,  a "." is printed on the screen.  The program  is  not 
  59. particularly fast, so you will see the "."s crawl across the screen.
  60.  
  61.      You  may  see a "*" appear on the screen from time to time and  then 
  62. disappear.  This  indicates that garbage collection is  in  process.  The 
  63. program  is attempting to reclaim memory which has been used,  but is  no 
  64. longer accessible. 
  65.  
  66.      When the classification process has been completed, the message
  67.  
  68. Output the tree to what file (Press <ENTER> for screen) ?
  69.  
  70. will appear. You may save the tree to a file or press <ENTER> to print it 
  71. on the screen.  The format of the tree is described in the BYTE  article. 
  72. If the size of the tree is such that its width exceeds 80 columns, it may 
  73. not  print properly.  After displaying the tree on the screen,  a message 
  74. telling you to press any key to continue will be displayed.  To print the 
  75. tree on the printer enter "lst:" as the file name.
  76.  
  77.      For instance,  the example file, profit.ex included with the program 
  78. will produce the following tree as output:
  79.  
  80.    (age (old      ( profit (down)))
  81.         (new      ( profit (up  )))
  82.         (midlife  (competition (no  (profit (up)))
  83.                                (yes (profit (down))))
  84.  
  85.  
  86.      Next, the program will display
  87.  
  88. Output the rules to what file (Press <ENTER> for screen) ?
  89.  
  90. Enter the name of the file which is to contain the rules. If this file is 
  91. to  be  a MicroExpert knowledge base,  be sure to include  the  extension 
  92. ".KB" to the file name.  The program will also write a series of  prompts 
  93. for the attributes.
  94.  
  95.      The file profit.ex will produce the following rules ane prompts:
  96.  
  97.  
  98. 1
  99. If   age is old
  100. then profit is down
  101. .
  102.  
  103. 2
  104. If   age is midlife
  105. and  competition is no
  106. then profit is up
  107. .
  108.  
  109. 3
  110. If   age is midlife
  111. and  competition is yes
  112. then profit is down
  113. .
  114.  
  115. 4
  116. If   age is new
  117. then profit is up
  118. .
  119.  
  120.  
  121. Prompt competition
  122. What is the value of competition ?
  123. .
  124.  
  125. Prompt age
  126. What is the value of age ?
  127. .
  128.  
  129.      Finally  the program will clear the screen and request a new example 
  130. file.  At this point you can enter a new example file or press <ENTER> to 
  131. exit the program.
  132.  
  133.                               Example Files
  134.  
  135.      Example  files are simply Ascii text files which are created with  a 
  136. text  editor.  The program ignores blank lines and comments in the files. 
  137. Comments  begin with "(*" and end with "*)".  A comment may  extend  over 
  138. several  lines.  The  first line in the file which is not a comment or  a 
  139. blank line must contain the attribute names. The format of this line is
  140.  
  141.     class name,attribute1,attribute2,.....
  142.  
  143. The class name must come first,  followed by the names of the  attributes 
  144. separated  by  commas.  Leading and trailing blanks in attribute are  not 
  145. significant.  Internal spaces are.  Therefore,  "dog and cat" is not  the 
  146. same  as  "dogandcat".  The program is also case sensitive,  so "Dog"  is 
  147. considered different from "dog". The program does not check for duplicate 
  148. attributes,  but of course,  any knowledge base produced using  duplicate 
  149. attribute names is likely to be incorrect.
  150.  
  151.      Following  the  line containing the attribute names are one or  more 
  152. lines  containing  examples.  Each example line contains  a  class  value 
  153. followed  by  a  series of attribute values  separated  by  commas.  Each 
  154. example must fit on one line. The general format is
  155.  
  156.     class value,value of attribute1,value of attribute2,.....
  157.  
  158. The  attributes must be in the same order as they are listed in the first 
  159. line,  although there is no way for the program to check on this. As with 
  160. attribute and class names,  internal spaces are significant,  leading and 
  161. trailing spaces are not.  "don't care" values are indicated by a  "*".  A 
  162. "don't  care"  value indicates that the value does not contribute to  the 
  163. example,  i.e.  you  will get the same result no matter what  value  this 
  164. attribute takes on.
  165.  
  166.      The following is the contents of the file for the example set in the 
  167. BYTE article: (it is included with the program in the file profit.ex)
  168.  
  169.  
  170. (* Example file for Byte Article   *)
  171.  
  172. (* Copyright [c] 1986    MicroExpert Systems
  173.                          Box 430 RD 2
  174.                          Nassau, NY 12123  *) 
  175.  
  176.              (* Attributes *)
  177.  
  178. profit    ,age        ,competition    ,type
  179.  
  180.              (* Examples *)
  181. down    ,old        ,no        ,software
  182. down    ,midlife    ,yes        ,software
  183. up    ,midlife    ,no        ,hardware
  184. down    ,old        ,no        ,hardware
  185. up    ,new        ,no        ,hardware
  186. up    ,new        ,no        ,software
  187. up    ,midlife    ,no        ,software
  188. up    ,new        ,yes        ,software
  189. down    ,midlife    ,yes        ,hardware
  190. down    ,old        ,yes        ,software
  191.  
  192. The  first example line can be read,  "profit is down for a company whose 
  193. age  is old,  has no significant competetition and whose product type  is 
  194. software."
  195.  
  196.                           Numerical Attributes
  197.  
  198.      Numerical  attributes  are  handled in the name manner  as  symbolic 
  199. (non-numerical)  attributes,  except  that ":number" is appended  to  the 
  200. attribute  name.  ":number"  is removed from the  attribute  name  before 
  201. printing  and  will not appear in either the tree or the knowledge  base. 
  202. Values  for numeric attributes must be with in the range  +/- 1.0E+37  to 
  203. +/- 1.0E-37.  The  numbers  may be entered in integer,  real or  floating 
  204. point  format.   The  following  example  set  demonstrates  the  use  of 
  205. numerical  attributes.  There  is  a  "don't care" value  in  the  second 
  206. example.
  207.  
  208.  
  209. (* Numerical Attribute Example file *)
  210.  
  211. (* Copyright [c] 1986    MicroExpert Systems
  212.                          Box 430 RD 2
  213.                          Nassau, NY 12123  *) 
  214.  
  215.              (* Attributes *)
  216.  
  217. profit    ,age:number     ,competition    ,type
  218.  
  219.              (* Examples *)
  220. down    ,5.0            ,no        ,software
  221. down    ,2.5            ,*        ,software
  222. up    ,2.5           ,no        ,hardware
  223. down    ,5        ,no        ,hardware
  224. up    ,1        ,no        ,hardware
  225. up    ,1        ,no        ,software
  226. up    ,2.5            ,no        ,software
  227. up    ,1        ,yes        ,software
  228. down    ,2              ,yes        ,hardware
  229. down    ,5        ,yes        ,software
  230.  
  231.