Top Banner
Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: [email protected]
43
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Weka: Experimenter and Knowledge Flow interfaces

Neil Mac Parthaláinemail: [email protected]

Page 2: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

What is different from Explorer?

• Experimenter is used for ‘batches’ of experiments• Can only be used for Classification and Regression

problems*• Results are generated in a different way– Explorer:

% correct = (sum of correctly classified instances for all test folds)/(Total No. of instances in dataset)

– Experimenter:% correct = Average of correctly predicted over all folds

*Possible to perform attribute selection but not covered here

Page 3: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Experimenter - Overview

• Compare the performance of different learning schemes easily

• Allows better analysis than Explorer• Results: write-to-file or database• Evaluation: cross-validation, learning curve, or

hold-out• Ability to iterate over different parameter

settings• Statistical significance tests “for free”!

Page 4: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Experimenter - Overview

• The interface essentially has three ‘panes’:

– Setup: Configure experiments

– Run: Generate results files

– Analyse: Analyse the results of the experiments

Page 5: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 6: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 7: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 8: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 9: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 10: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 11: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 12: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Always use ‘corrected’ T-Tester!

Use this to decide how you compare results

Page 13: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 14: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 15: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Lots of different ways to compare results!

Page 16: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 17: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Knowledge Flow Interface

• “Visual: drag-and-drop” user interface for WEKA - intuitive

• Java-Beans-based• Can do everything that Explorer does (plus a bit more),

but not as comprehensively as Experimenter• Data sources, classifiers, etc. are beans and can be

connected graphically• Data “flows” through modules: e.g.,“data source” ->“filter” ->“classifier”-> “evaluator”• KF layouts can be saved and re-used later

Page 18: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Knowledge Flow: An Example

• What we want to do:– Take a dataset– Do some attribute selection– Perform some classification on the reduced data

using 10 fold CV– Examine the subsets selected for each CV fold– Visualise the results in text format and ROC

Page 19: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Getting Started

Page 20: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 21: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

A few ‘hidden’ steps…

Page 22: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.
Page 23: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Add the Classifier learner

Page 24: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

…and the performance evaluator

Page 25: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

TextViewers can be used for visualisation of results as well as examining the processes – more later…

Page 26: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

‘Right-clicking’ on each ‘block’ allows you to configure it as well as ‘wire-up’ to others…

Page 27: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Connect: dataSet to CrossValidationFoldMaker

Page 28: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Continue to ‘wire-up’ each ‘block’…

Page 29: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

…and so on

Page 30: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

To see the results output: ‘dump’ the text to TextViewer…

Page 31: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

When you have finished ‘wiring-up’, it’s time to configure each of the components/blocks…

Page 32: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Set the path/filename(s) of the datasets you would like to load…

Page 33: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Once all is configured, you are ready to start…

Page 34: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Once all experiments have finished, we can visualise the results…

Page 35: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Output is similar to that of console window of Explorer

Page 36: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

But there are also ways save these results if we want to keep them for later…

Page 37: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

TextViewer components are also useful for ‘looking-inside’ processes…

Page 38: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

For example: attribute selection….

Page 39: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

It is also possible to visualise data in a similar way to Explorer…e.g. ROC/threshold curves

Page 40: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Some problems you may encounter…

Often caused by incorrectly defined .arff files… - too many attribs defined in the header - Incorrectly labelled @attribute types

Be aware also that WEKA labels the dataset by whatever name you put in the @Relation field!

Page 41: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Some problems you may encounter…

You may experience an error related to Java heap size if:- The initial heap size is too-small- You load a large dataset- Attempt to run a large number of experiments

Can be fixed by initialising the JVM with a large initial heap size:Java –Xmx2048m ...

Page 42: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Write your own algorithms…

• WEKA is Open Source!• Much of the work is already done for you• Take advantage of the WEKA framework• Writing code and contributing to the WEKA

project now easier than before see:http://weka.wikispaces.com/How+can+I+contribute+to+WEKA%3F

Page 43: Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin email: ncm@aber.ac.uk.

Conclusion

• Experimenter and Knowledge Flow: – offer useful and flexible ways to perform a range of

batches of experiments– Beware of the way in which results are generated!– KF is particularly useful for visualisation – Experimenter more suited to learning

• Just a snapshot of capabilities of WEKA!• Want more info? email me (or Richard)• These slides available at:

http://users.aber.ac.uk/ncm/weka_slides