WEKA Manual
for Version 3-6-13
Remco R. Bouckaert
Eibe Frank
Mark Hall
Richard Kirkby
Peter Reutemann
Alex Seewald
David Scuse
September 9, 2015
c
2002-2015
University of Wa ikato, Hamilton, New Zealand
Alex Seewald (original Commnd-line primer )
David Scuse (original Experimenter tutorial)
This manual is licensed under the GNU General Public License
version 2. More information about this license can be found at
http://www.gnu.org/copyleft/gpl.html
Contents
I The Command-line 5
1 A command-line primer 7
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.1 Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.2 Classifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.3 weka.filters . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2.4 weka.classifiers . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
II The Graphical User Interface 19
2 Launching WEKA 21
3 Simple CLI 25
3.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.2 Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3 Command redirection . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4 Command completion . . . . . . . . . . . . . . . . . . . . . . . . 27
4 Explorer 29
4.1 The user interface . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.1.1 Section Tabs . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.1.2 Status Box . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.1.3 Log Button . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.1.4 WEKA Status Ic on . . . . . . . . . . . . . . . . . . . . . . 30
4.1.5 Graphical output . . . . . . . . . . . . . . . . . . . . . . . 30
4.2 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.1 Loading Data . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.2 The Current Relation . . . . . . . . . . . . . . . . . . . . 31
4.2.3 Working With Attributes . . . . . . . . . . . . . . . . . . 32
4.2.4 Working With Filters . . . . . . . . . . . . . . . . . . . . 33
4.3 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.3.1 Selecting a Clas sifier . . . . . . . . . . . . . . . . . . . . . 35
4.3.2 Test Options . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.3.3 The Class Attribute . . . . . . . . . . . . . . . . . . . . . 36
4.3.4 Training a Classifier . . . . . . . . . . . . . . . . . . . . . 37
3
4 CONTENTS
4.3.5 The Clas sifier Output Text . . . . . . . . . . . . . . . . . 37
4.3.6 The Result List . . . . . . . . . . . . . . . . . . . . . . . . 37
4.4 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.4.1 Selecting a Clusterer . . . . . . . . . . . . . . . . . . . . . 39
4.4.2 Cluster Modes . . . . . . . . . . . . . . . . . . . . . . . . 39
4.4.3 Ignoring Attributes . . . . . . . . . . . . . . . . . . . . . . 39
4.4.4 Working with Filters . . . . . . . . . . . . . . . . . . . . . 40
4.4.5 Learning Clusters . . . . . . . . . . . . . . . . . . . . . . . 40
4.5 Associating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.5.1 Setting Up . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.5.2 Learning Associations . . . . . . . . . . . . . . . . . . . . 41
4.6 Selecting Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.6.1 Searching and Evaluating . . . . . . . . . . . . . . . . . . 42
4.6.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.6.3 Performing Selection . . . . . . . . . . . . . . . . . . . . . 42
4.7 Visualizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.7.1 The scatter plot matrix . . . . . . . . . . . . . . . . . . . 44
4.7.2 Selecting an individual 2D scatter plot . . . . . . . . . . . 44
4.7.3 Selecting Instances . . . . . . . . . . . . . . . . . . . . . . 45
5 Experimenter 47
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.2 Standard Experiments . . . . . . . . . . . . . . . . . . . . . . . . 48
5.2.1 Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.2.1.1 New experiment . . . . . . . . . . . . . . . . . . 48
5.2.1.2 Results destination . . . . . . . . . . . . . . . . 48
5.2.1.3 Experiment type . . . . . . . . . . . . . . . . . . 50
5.2.1.4 Datasets . . . . . . . . . . . . . . . . . . . . . . 52
5.2.1.5 Iteration control . . . . . . . . . . . . . . . . . . 53
5.2.1.6 Algorithms . . . . . . . . . . . . . . . . . . . . . 53
5.2.1.7 Saving the setup . . . . . . . . . . . . . . . . . . 55
5.2.1.8 Running an Experiment . . . . . . . . . . . . . . 56
5.2.2 Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.2.2.1 Defining an Experiment . . . . . . . . . . . . . . 57
5.2.2.2 Running an Experiment . . . . . . . . . . . . . . 60
5.2.2.3 Changing the Experiment Parameters . . . . . . 62
5.2.2.4 Other Result Producers . . . . . . . . . . . . . . 69
5.3 Cluster Expe riments . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.4 Remote Experiments . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.4.1 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.4.2 Database Server Setup . . . . . . . . . . . . . . . . . . . . 77
5.4.3 Remote Engine Setup . . . . . . . . . . . . . . . . . . . . 78
5.4.4 Configuring the Exp e rimenter . . . . . . . . . . . . . . . . 79
5.4.5 Multi-core support . . . . . . . . . . . . . . . . . . . . . . 80
5.4.6 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . 80
5.5 Analysing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.5.1 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.5.2 Saving the Results . . . . . . . . . . . . . . . . . . . . . . 85
5.5.3 Changing the Baseline Scheme . . . . . . . . . . . . . . . 85
5.5.4 Statistical Significa nce . . . . . . . . . . . . . . . . . . . . 86
CONTENTS 5
5.5.5 Summary Test . . . . . . . . . . . . . . . . . . . . . . . . 86
5.5.6 Ranking Test . . . . . . . . . . . . . . . . . . . . . . . . . 87
6 KnowledgeFlow 89
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
6.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
6.3 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.3.1 DataSources . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.3.2 DataSinks . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.3.3 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.3.4 Classifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.3.5 Clusterers . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.3.6 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3
6.3.7 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . 94
6.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.4.1 Cross-validated J48 . . . . . . . . . . . . . . . . . . . . . 95
6.4.2 Plotting multiple ROC curves . . . . . . . . . . . . . . . . 97
6.4.3 Processing data incrementally . . . . . . . . . . . . . . . . 99
6.5 Plugin Facility . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
7 ArffViewer 103
7.1 Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
7.2 Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
8 Bayesian Network Classifiers 109
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
8.2 Local score based structure learning . . . . . . . . . . . . . . . . 113
8.2.1 Local score metr ics . . . . . . . . . . . . . . . . . . . . . 113
8.2.2 Search algorithms . . . . . . . . . . . . . . . . . . . . . . 114
8.3 Conditional independence test based structur e learning . . . . . . 117
8.4 Global score metric based structure learning . . . . . . . . . . . . 119
8.5 Fixed structure ’learning’ . . . . . . . . . . . . . . . . . . . . . . 120
8.6 Distribution learning . . . . . . . . . . . . . . . . . . . . . . . . . 120
8.7 Running from the command line . . . . . . . . . . . . . . . . . . 122
8.8 Inspe c ting Bayesian networks . . . . . . . . . . . . . . . . . . . . 132
8.9 Bayes Network GUI . . . . . . . . . . . . . . . . . . . . . . . . . 135
8.10 Bayesian nets in the experimenter . . . . . . . . . . . . . . . . . 147
8.11 Adding your own Bayesian network learners . . . . . . . . . . . . 147
8.12 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
8.13 Future development . . . . . . . . . . . . . . . . . . . . . . . . . 150
III Data 153
9 ARFF 155
9.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
9.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
9.2.1 The ARFF Header Section . . . . . . . . . . . . . . . . . 156
9.2.2 The ARFF Da ta Section . . . . . . . . . . . . . . . . . . . 158
9.3 Sparse ARFF files . . . . . . . . . . . . . . . . . . . . . . . . . . 159