README
Upload User: rhdiban
Upload Date: 2013-08-09
Package Size: 15085k
Code Size: 15k
Category:

Windows Develop

Development Platform:

Java

  1. =====================================================================
  2.                                                                        
  3.                               ======                                   
  4.                               README                                   
  5.                               ======                                   
  6.                                                                        
  7.                             WEKA 3.2.3
  8.                             28 May 2002
  9.                                                                        
  10.                  Java Programs for Machine Learning 
  11.                                                                        
  12. Copyright (C) 1998, 1999, 2000, 2001  Eibe Frank, 
  13.    Leonard Trigg, Mark Hall, Richard Kirkby
  14.                  email: wekasupport@cs.waikato.ac.nz            
  15.                                                                        
  16. =====================================================================
  17. NOTE: We are following the Linux model of releases, where, an even
  18. second digit of a release number indicates a "stable" release and an
  19. odd second digit indicates a "development" release (e.g. 3.0.x is a
  20. stable release, and 3.1.x is a developmental release). If you are
  21. using a developmental release, you might get to play with extra funky
  22. features, but it is entirely possible that these features
  23. come/go/transmogrify from one release to the next.  If you require
  24. stability (e.g. if you are using Weka for teaching), use a stable
  25. release.
  26. =====================================================================
  27. Contents:
  28. ---------
  29. 1. Installation
  30. 2. Getting started
  31.    - Classifiers
  32.    - Association rules
  33.    - Filters
  34.    - Data format
  35.    - Experiment package 
  36.    - GUIs               
  37. 3. Tutorial
  38. 4. Source code
  39. 5. Credits
  40. 6. Submission of code and bug reports
  41. 7. Copyright
  42. ----------------------------------------------------------------------
  43. 1. Installation:
  44. ----------------
  45. For people familiar with their command-line interface
  46. -----------------------------------------------------
  47. a) Set WEKAHOME to be the directory which contains this README.
  48. b) Add $WEKAHOME/weka.jar to your CLASSPATH environment variable.
  49. c) Bookmark $WEKAHOME/doc/packages.html in your web browser.
  50. To start a simple GUI for using Weka
  51. ------------------------------------
  52. If you are using Java 2 (JDK 1.2 or equivalent) or you have Swing
  53. 1.1.1 (or later installed for Java 1.1), you should be able to just
  54. double-click on the weka.jar icon, or from a command-line (assuming
  55. you are in the directory containing weka.jar) type
  56. java -jar weka.jar
  57. or if you are using Windows use
  58. javaw -jar weka.jar
  59. This will start a small GUI (GUIChooser) from which you can select the
  60. SimpleCLI interface or the more sophisticated Explorer and
  61. Experimenter interfaces (see below). SimpleCLI just acts like a simple
  62. command shell and has been provided mainly for Mac users who don't
  63. have their own shell :)
  64. If you are using NT/Windows you may need to create a file association
  65. before you can double click on the weka.jar icon. Open the file
  66. Explorer or a file browser window. Select View (or perhaps
  67. Tools)->Options. Click on File Types. Click on New Type. Fill in the
  68. Type field (put something like "java jar files"). Fill in the
  69. Associated Extension ("jar"). Add new Action, with Action name Open,
  70. and application as "javaw.exe -jar" (you will probably need to browse
  71. to the location of your JRE to get the path correct for javaw---you
  72. will find javaw in the "bin" directory of wherever your JRE is
  73. installed).
  74. If you are using some other Java virtual machine you need to start
  75. GUIChooser from within weka.jar. For JDK 1.1 users something
  76. like the following:
  77. java -classpath weka.jar:$CLASSPATH weka.gui.GUIChooser
  78. or if you are using Windows use
  79. javaw -classpath weka.jar;$CLASSPATH weka.gui.GUIChooser
  80. ----------------------------------------------------------------------
  81. 2. Getting started:
  82. -------------------
  83. In the following, the names of files assume use of a unix command-line
  84. with environment variables. For other command-lines (including SimpleCLI)
  85. you should substitute the name of the directory where weka.jar lives 
  86. where you see $WEKAHOME. If your platform uses something other than / as
  87. the path separator, also make the appropriate substitutions.
  88. ===========
  89. Classifiers
  90. ===========
  91. Try:
  92. java weka.classifiers.j48.J48 -t $WEKAHOME/data/iris.arff
  93. This prints out a decision tree classifier for the iris dataset 
  94. and ten-fold cross-validation estimates of its performance. If you
  95. don't pass any options to the classifier, WEKA will list all the 
  96. available options. Try:
  97. java weka.classifiers.j48.J48
  98. The options are divided into "general" options that apply to most
  99. classification schemes in WEKA, and scheme-specific options that 
  100. only apply to the current scheme---in this case J48. WEKA has a
  101. common interface to all classification methods. Any class that 
  102. implements a classifier can be used in the same way as J48 is used
  103. above. WEKA knows that a class implements a classifier if it 
  104. extends the Classifier or DistributionClassifier classes in
  105. weka.classifiers. Almost all classes in weka.classifiers fall into
  106. this category. Try, for example:
  107. java weka.classifiers.NaiveBayes -t $WEKAHOME/data/labor.arff
  108. Here is a list of the most important classifiers currently 
  109. implemented in weka.classifiers:
  110. a) Classifiers for categorical prediction:
  111. weka.classifiers.IBk: k-nearest neighbour learner
  112. weka.classifiers.j48.J48: C4.5 decision trees 
  113. weka.classifiers.j48.PART: rule learner 
  114. weka.classifiers.NaiveBayes: naive Bayes with/without kernels
  115. weka.classifiers.OneR: Holte's OneR
  116. weka.classifiers.KernelDensity: kernel density classifier
  117. weka.classifiers.SMO: support vector machines
  118. weka.classifiers.Logistic: logistic regression
  119. weka.classifiers.AdaBoostM1: AdaBoost
  120. weka.classifiers.LogitBoost: logit boost
  121. weka.classifiers.DecisionStump: decision stumps (for boosting)
  122. b) Classifiers for numeric prediction:
  123. weka.classifiers.LinearRegression: linear regression
  124. weka.classifiers.m5.M5Prime: model trees
  125. weka.classifiers.IBk: k-nearest neighbour learner
  126. weka.classifiers.LWR: locally weighted regression
  127. weka.classifiers.RegressionByDiscretization: uses categorical classifiers
  128. =================
  129. Association rules
  130. =================
  131. Next to classification schemes, there is some other useful stuff in 
  132. WEKA. Association rules, for example, can be extracted using the 
  133. apriori algorithm. Try
  134. java weka.associations.Apriori -t $WEKAHOME/data/weather.nominal.arff
  135. =======
  136. Filters
  137. =======
  138. There are also a number of tools that allow you to manipulate a
  139. dataset. These tools are called filters in WEKA and can be found
  140. in weka.filters.
  141. weka.filters.DiscretizeFilter: discretizes numeric data
  142. weka.filters.AttributeFilter: deletes/selects attributes
  143. etc.
  144. Try:
  145. java weka.filters.DiscretizeFilter -i $WEKAHOME/data/iris.arff -c last
  146. ===========
  147. Data format
  148. ===========
  149. Datasets in WEKA have to be formatted according to the arff 
  150. format. Examples of arff files can be found in $WEKAHOME/data. 
  151. What follows is a short description of the file format. 
  152. A dataset has to start with a declaration of its name:
  153. @relation name
  154. followed by a list of all the attributes in the dataset (including 
  155. the class attribute). These declarations have the form
  156. @attribute attribute_name specification
  157. If an attribute is nominal, specification contains a list of the 
  158. possible attribute values in curly brackets:
  159. @attribute nominal_attribute {first_value, second_value, third_value}
  160. If an attribute is numeric, specification is replaced by the keyword 
  161. numeric: (Integer values are treated as real numbers in WEKA.)
  162. @attribute numeric_attribute numeric
  163. In addition to these two types of attributes, there also exists a
  164. string attribute type. This attribute provides the possibility to
  165. store a comment or ID field for each of the instances in a dataset:
  166. @attribute string_attribute string
  167. After the attribute declarations, the actual data is introduced by a 
  168. @data
  169. tag, which is followed by a list of all the instances. The instances 
  170. are listed in comma-separated format, with a question mark 
  171. representing a missing value. Comments are lines starting with %
  172. ==================
  173. Experiment package
  174. ==================
  175. There is now support for running experiments that involve evaluating
  176. classifiers on repeated randomizations of datasets, over multiple
  177. datasets (you can do much more than this, besides). The classes for
  178. this reside in the weka.experiment package. The basic architecture is
  179. that a ResultProducer (which generates results on some randomization
  180. of a dataset) sends results to a ResultListener (which is responsible
  181. for stating whether it already has the result, and otherwise storing
  182. results).
  183. Example ResultListeners include:
  184. weka.experiment.CSVResultListener: outputs results as
  185. comma-separated-value files.
  186. weka.experiment.InstancesResultListener: converts results into a set
  187. of Instances.
  188. weka.experiment.DatabaseResultListener: sends results to a database
  189. via jdbc. 
  190. Example ResultProducers include:
  191. weka.experiment.RandomSplitResultProducer: train/test on a % split
  192. weka.experiment.CrossValidationResultProducer: n-fold cross-validation
  193. weka.experiment.AveragingResultProducer: averages results from another
  194. ResultPoducer 
  195. weka.experiment.DatabaseResultProducer: acts as a cache for results,
  196. storing them in a database.
  197. The RandomSplitResultProducer and CrossValidatioResultProducer make
  198. use of a SplitEvaluator to obtain actual results for a particular
  199. split, provided are ClassifierSplitEvaluator (for nominal
  200. classification) and RegressionSplitEvaluator (for numeric
  201. classification). Each of these uses a Classifier for actual results
  202. generation. 
  203. So, you might have a DatabaseResultListener, that is sent results from
  204. an AveragingResultProducer, which produces averages over the n results
  205. produced for each run of an n-fold CrossValidationResultProducer,
  206. which in turn is doing nominal classification through a
  207. ClassifierSplitEvaluator, which uses OneR for prediction. Whew. But
  208. you can combine these things together to do pretty much whatever you
  209. want. You might want to write a LearningRateResultProducer that splits
  210. a dataset into increasing numbers of training instances.
  211. In terms of database connectivity, we use InstantDB, a free database
  212. implemented entirely in Java. It is available from:
  213. http://www.instantdb.co.uk/index.htm
  214. From there you will also be able to find a RmiJdbc bridge which is
  215. useful for running a server that just listens for experiment results
  216. from other machines. When using classes that access a database, you
  217. will probably want to create a properties file that specifies which
  218. jdbc drivers to use, and where to find the database. This file should
  219. reside in your home directory or the current directory and be called
  220. "DatabaseUtils.props". An example is provided in weka/experiment, this
  221. file is used unless it is overidden by one in your home directory or
  222. the current directory (in that order).
  223. To run a simple experiment from the command line, try:
  224. java weka.experiment.Experiment -r -T datasets/UCI/iris.arff  
  225.   -D weka.experiment.InstancesResultListener 
  226.   -P weka.experiment.RandomSplitResultProducer -- 
  227.   -W weka.experiment.ClassifierSplitEvaluator -- 
  228.   -W weka.classifiers.OneR
  229. (Try "java weka.experiment.Experiment -h" to find out what these options
  230. mean) 
  231. If you have your results as a set of instances, you can perform paired
  232. t-tests using weka.experiment.PairedTTester (use the -h option to find
  233. out what options it needs).
  234. This is all much easier from the Experiment Environment GUI :-)
  235. ====
  236. GUIs
  237. ====
  238. We now have two GUIs to make using Weka a little easier: one that acts
  239. much as the original interface to the old Weka 2 system, and one for
  240. conducting experiments (see README_Experiment_Gui). Both of these
  241. interfaces use Swing, so you need to either be using Java 2 or have
  242. downloaded Swing 1.1.1 or later for your JDK 1.1. One of the
  243. components of the GUIs is a generic object editor that requires a
  244. configuration "GenericObjectEditor.props". There is an example file in
  245. weka/gui. This file will be used unless it is overidden by one in your
  246. home directory or the current directory (in that order).  This file
  247. simply specifies for each superclass which subclasses to offer as
  248. choices. For example, which Classifiers are available/wanted to be
  249. used when an object requires a property of type Classifier. An example
  250. file is provided.
  251. To start the Explorer:
  252. java weka.gui.explorer.Explorer
  253. To start the experiment editor:
  254. java weka.gui.experiment.Experimenter
  255. These _really_ need more documentation, but that'll do to get you
  256. started :)
  257. ----------------------------------------------------------------------
  258. 4. Tutorial:
  259. ------------
  260. A tutorial on how to use WEKA is in $WEKAHOME/Tutorial.pdf. However,
  261. not everything in WEKA is covered in the Tutorial. For a complete list
  262. you have to look at the online documentation
  263. $WEKAHOME/doc/packages.html.
  264. In particular, Tutorial.pdf is a draft from the forthcoming book (see
  265. our web page), and so only describes features in the stable 3.0
  266. release.
  267. ----------------------------------------------------------------------
  268. 5. Source code:
  269. ---------------
  270. The source code for WEKA is in $WEKAHOME/weka-src.jar. To expand it, 
  271. use the jar utility that's in every Java distribution.
  272. ----------------------------------------------------------------------
  273. 6. Credits:
  274. -----------
  275. Len Trigg           - weka.experiment, weka.gui, weka.gui.experiment,
  276.                       weka.gui.explorer, weka.filters, weka.estimators, 
  277.                       weka.classifiers, weka.core
  278. Eibe Frank          - weka.core, weka.classifiers, 
  279.                       weka.classifiers.j48, weka.filters, 
  280.                       weka.associations
  281. Mark Hall           - weka.clusterers, weka.attributeSelection,
  282.                       weka.classifiers.DecisionTable, weka.gui, 
  283.       weka.gui.explorer, weka.gui.experiment, 
  284.       weka.gui.visualize, weka.converters
  285. Richard Kirkby      - weka.classifiers.adtree
  286. Malcolm Ware        - weka.classifiers.neural, 
  287.                       weka.classifiers.UserClassifier
  288. Bernhard Pfahringer - weka.classifiers.adtree
  289. Yong Wang           - weka.classifiers.m5
  290. Abdelaziz Mahoui    - weka.classifiers.kstar 
  291. Ian H. Witten       - weka.classifiers.OneR, weka.classifiers.Prism
  292. Stuart Inglis       - weka.classifiers.IB1
  293. ... and others!
  294. ----------------------------------------------------------------------
  295. 7. Call for code and bug reports:
  296. ---------------------------------
  297. If you have implemented a learning scheme, filter, application,
  298. visualization tool, etc., using the WEKA classes, and you think it 
  299. should be included in WEKA, send us the code, and we can put it
  300. in the next WEKA distribution.
  301. If you find any bugs, send a fix to wekasupport@cs.waikato.ac.nz.
  302. If that's too hard, just send us a bug report.
  303. -----------------------------------------------------------------------
  304. 8. Copyright:
  305. -------------
  306. WEKA is distributed under the GNU public license. Please read
  307. the file COPYING.
  308. -----------------------------------------------------------------------