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