Upload
tim-hsu
View
114
Download
6
Embed Size (px)
DESCRIPTION
Citation preview
WEKA
13年9月24日星期二
WEKA 威卡!
13年9月24日星期二
History
• Originally written in TCL/TK
• Change to JAVA since 1997
13年9月24日星期二
What is WEKA
• Ease of Use GUI
• Command Line Tools
• Integrated with STDIO
• Pure Java implementation
• Integrated with Jython, Groovy
13年9月24日星期二
A Standard ML Flow
13年9月24日星期二
iris-versicolor 變色鳶尾
iris-virginica
13年9月24日星期二
別人怎麼看資料?
• IRIS Dataset
• Class, setosa, versicolor, virginica
• Attributes
• sepal_length
• sepal_width
• petal_length
• petal_width
13年9月24日星期二
13年9月24日星期二
Learn
• Methods
• Decision Tree ( J48 )
• NaiveBayes
• Your data will restrict your method
13年9月24日星期二
Validation
• Cross Validation
• split data to test and training
• loo ( Leave One Out)
•
13年9月24日星期二
Back to Weka GUI
• Preprocess
• Classify
13年9月24日星期二
Preprocess
• Open File
• Apply Filter
• Observe
13年9月24日星期二
Open File
• CSV, JSON, ARFF....
• WEKA handles ARFF only in the past
• There is a lot of utility convert file to ARFF
•
13年9月24日星期二
Demo
• Open File
• Observe Data
• Apply Filter
• supervised filter
• instance filter
13年9月24日星期二
classify
• apply learning method
• Test options
• model is trained by all training data
13年9月24日星期二
Demo
• Choose J48
• Explain Output
• Adjust Algorithm
13年9月24日星期二
Other than GUI
• For Automation
• command line
• python, java
13年9月24日星期二
CLASSPATH
• export CLASSPATH=$PWD/weka.jar
• add the jar to CLASSPATH
13年9月24日星期二
Demo for cli
• Click Right Key, Copy Run Infomation
• training
• java weka.classifiers.trees.J48 -O -C 0.08 -M 1 -t ../data/iris.arff -d model_from_cmd
• testing
• java weka.classifiers.trees.J48 -T ../data/iris.arff -l model_from_cmd
13年9月24日星期二
Integration with Python
• Jython
• Runs on top of java
• jnius
• Use Java with JNI
• weka # python package
• Interface with Subprocess
13年9月24日星期二
Demo for Jython
• Print the builder & predict
13年9月24日星期二
Conclusion
• You can lean without any coding
• Good GUI tool
• Clear Workflow
• writing java is no quick
• Utilize CLI, python weka to write faster
13年9月24日星期二