WEKA Manual
for Version 3-7-5
Remco R. Bouckaert
Eibe Frank
Mark Hall
Richard Kirkby
Peter Reutemann
Alex Seewald
David Scuse
October 28, 2011
c
2002-2011
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 11
1 A command-line primer 13
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.2 Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2.1 Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2.2 Classifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.3 weka.filters . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.4 weka.classifiers . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.4 Additional packages and the package manager . . . . . . . . . . . 24
1.4.1 Package management . . . . . . . . . . . . . . . . . . . . 2 5
1.4.2 Running installed learning algorithms . . . . . . . . . . . 26
II The Graphical User Interface 29
2 Launching WEKA 31
3 Package Manager 35
3.1 Main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Installing and removing packages . . . . . . . . . . . . . . . . . . 36
3.3 Using a http proxy . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4 Using an alternative central package meta data repository . . . . 37
4 Simple CLI 39
4.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2 Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.3 Command redirection . . . . . . . . . . . . . . . . . . . . . . . . 40
4.4 Command completion . . . . . . . . . . . . . . . . . . . . . . . . 41
5 Explorer 43
5.1 The user interface . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1.1 Section Tabs . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1.2 Status Box . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1.3 Log Button . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.1.4 WEKA Status Ic on . . . . . . . . . . . . . . . . . . . . . . 44
5.1.5 Graphical output . . . . . . . . . . . . . . . . . . . . . . . 44
5.2 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3
4 CONTENTS
5.2.1 Loading Data . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2.2 The Current Relation . . . . . . . . . . . . . . . . . . . . 45
5.2.3 Working With Attributes . . . . . . . . . . . . . . . . . . 46
5.2.4 Working With Filters . . . . . . . . . . . . . . . . . . . . 47
5.3 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3.1 Selecting a Classifier . . . . . . . . . . . . . . . . . . . . . 49
5.3.2 Test Options . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3.3 The Clas s Attribute . . . . . . . . . . . . . . . . . . . . . 50
5.3.4 Training a Classifier . . . . . . . . . . . . . . . . . . . . . 51
5.3.5 The Clas sifier Output Text . . . . . . . . . . . . . . . . . 51
5.3.6 The Result List . . . . . . . . . . . . . . . . . . . . . . . . 51
5.4 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.4.1 Selecting a Clusterer . . . . . . . . . . . . . . . . . . . . . 53
5.4.2 Cluster Modes . . . . . . . . . . . . . . . . . . . . . . . . 53
5.4.3 Ignoring Attributes . . . . . . . . . . . . . . . . . . . . . . 53
5.4.4 Working with Filters . . . . . . . . . . . . . . . . . . . . . 54
5.4.5 Learning Clusters . . . . . . . . . . . . . . . . . . . . . . . 5 4
5.5 Associating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.5.1 Setting Up . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.5.2 Learning Associations . . . . . . . . . . . . . . . . . . . . 55
5.6 Selecting Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.6.1 Searching and Evaluating . . . . . . . . . . . . . . . . . . 56
5.6.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.6.3 Performing Selection . . . . . . . . . . . . . . . . . . . . . 56
5.7 Visualizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.7.1 The scatter plot matrix . . . . . . . . . . . . . . . . . . . 58
5.7.2 Selecting an individual 2D scatter plot . . . . . . . . . . . 58
5.7.3 Selecting Instances . . . . . . . . . . . . . . . . . . . . . . 59
6 Experimenter 61
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.2 Standard Experiments . . . . . . . . . . . . . . . . . . . . . . . . 62
6.2.1 Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.2.1.1 New experiment . . . . . . . . . . . . . . . . . . 62
6.2.1.2 Results destination . . . . . . . . . . . . . . . . 62
6.2.1.3 Experiment type . . . . . . . . . . . . . . . . . . 64
6.2.1.4 Datasets . . . . . . . . . . . . . . . . . . . . . . 66
6.2.1.5 Iteration control . . . . . . . . . . . . . . . . . . 67
6.2.1.6 Algorithms . . . . . . . . . . . . . . . . . . . . . 67
6.2.1.7 Saving the setup . . . . . . . . . . . . . . . . . . 69
6.2.1.8 Running an Experiment . . . . . . . . . . . . . . 70
6.2.2 Advanced . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.2.2.1 Defining an Experiment . . . . . . . . . . . . . . 71
6.2.2.2 Running an Experiment . . . . . . . . . . . . . . 74
6.2.2.3 Changing the Experiment Parameters . . . . . . 76
6.2.2.4 Other Result Producers . . . . . . . . . . . . . . 83
6.3 Cluster Expe riments . . . . . . . . . . . . . . . . . . . . . . . . . 89
6.4 Remote Experiments . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.4.1 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.4.2 Database Server Setup . . . . . . . . . . . . . . . . . . . . 92
CONTENTS 5
6.4.3 Remote Engine Setup . . . . . . . . . . . . . . . . . . . . 93
6.4.4 Configuring the Exp e rimenter . . . . . . . . . . . . . . . . 94
6.4.5 Multi-core supp ort . . . . . . . . . . . . . . . . . . . . . . 95
6.4.6 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . 95
6.5 Analysing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.5.1 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.5.2 Saving the Results . . . . . . . . . . . . . . . . . . . . . . 100
6.5.3 Changing the Baseline Scheme . . . . . . . . . . . . . . . 100
6.5.4 Statistical Significance . . . . . . . . . . . . . . . . . . . . 101
6.5.5 Summary Test . . . . . . . . . . . . . . . . . . . . . . . . 101
6.5.6 Ranking Test . . . . . . . . . . . . . . . . . . . . . . . . . 102
7 KnowledgeFlow 103
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
7.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
7.3 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3.1 DataSources . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3.2 DataSinks . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3.3 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3.4 Classifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3.5 Clusterers . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3.6 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3.7 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . 108
7.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 09
7.4.1 Cross-validated J48 . . . . . . . . . . . . . . . . . . . . . 109
7.4.2 Plotting multiple ROC curves . . . . . . . . . . . . . . . . 111
7.4.3 Processing data incrementally . . . . . . . . . . . . . . . . 114
7.5 Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
7.5.1 Flow components . . . . . . . . . . . . . . . . . . . . . . . 116
7.5.2 Perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . 116
8 ArffViewer 119
8.1 Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
8.2 Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
9 Bayesian Network Classifiers 125
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
9.2 Local score based structure learning . . . . . . . . . . . . . . . . 129
9.2.1 Local score metr ics . . . . . . . . . . . . . . . . . . . . . 1 29
9.2.2 Search algorithms . . . . . . . . . . . . . . . . . . . . . . 130
9.3 Conditional independence test based structur e learning . . . . . . 133
9.4 Global score metric based structure learning . . . . . . . . . . . . 135
9.5 Fixed structure ’learning’ . . . . . . . . . . . . . . . . . . . . . . 136
9.6 Distribution learning . . . . . . . . . . . . . . . . . . . . . . . . . 136
9.7 Running from the command line . . . . . . . . . . . . . . . . . . 138
9.8 Inspe c ting Bayesian networks . . . . . . . . . . . . . . . . . . . . 148
9.9 Bayes Network GUI . . . . . . . . . . . . . . . . . . . . . . . . . 151
9.10 Bayesian nets in the experimenter . . . . . . . . . . . . . . . . . 163
9.11 Adding your own Bayesian network learners . . . . . . . . . . . . 163
9.12 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165