22
WEKA 13924日星期二

Ml weka

  • Upload
    tim-hsu

  • View
    114

  • Download
    6

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Ml weka

WEKA

13年9月24日星期二

Page 2: Ml weka

WEKA 威卡!

13年9月24日星期二

Page 3: Ml weka

History

• Originally written in TCL/TK

• Change to JAVA since 1997

13年9月24日星期二

Page 4: Ml weka

What is WEKA

• Ease of Use GUI

• Command Line Tools

• Integrated with STDIO

• Pure Java implementation

• Integrated with Jython, Groovy

13年9月24日星期二

Page 5: Ml weka

A Standard ML Flow

13年9月24日星期二

Page 6: Ml weka

iris-versicolor 變色鳶尾

iris-virginica

13年9月24日星期二

Page 7: Ml weka

別人怎麼看資料?

• IRIS Dataset

• Class, setosa, versicolor, virginica

• Attributes

• sepal_length

• sepal_width

• petal_length

• petal_width

13年9月24日星期二

Page 8: Ml weka

13年9月24日星期二

Page 9: Ml weka

Learn

• Methods

• Decision Tree ( J48 )

• NaiveBayes

• Your data will restrict your method

13年9月24日星期二

Page 10: Ml weka

Validation

• Cross Validation

• split data to test and training

• loo ( Leave One Out)

13年9月24日星期二

Page 11: Ml weka

Back to Weka GUI

• Preprocess

• Classify

13年9月24日星期二

Page 12: Ml weka

Preprocess

• Open File

• Apply Filter

• Observe

13年9月24日星期二

Page 13: Ml weka

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日星期二

Page 14: Ml weka

Demo

• Open File

• Observe Data

• Apply Filter

• supervised filter

• instance filter

13年9月24日星期二

Page 15: Ml weka

classify

• apply learning method

• Test options

• model is trained by all training data

13年9月24日星期二

Page 16: Ml weka

Demo

• Choose J48

• Explain Output

• Adjust Algorithm

13年9月24日星期二

Page 17: Ml weka

Other than GUI

• For Automation

• command line

• python, java

13年9月24日星期二

Page 18: Ml weka

CLASSPATH

• export CLASSPATH=$PWD/weka.jar

• add the jar to CLASSPATH

13年9月24日星期二

Page 19: Ml weka

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日星期二

Page 20: Ml weka

Integration with Python

• Jython

• Runs on top of java

• jnius

• Use Java with JNI

• weka # python package

• Interface with Subprocess

13年9月24日星期二

Page 21: Ml weka

Demo for Jython

• Print the builder & predict

13年9月24日星期二

Page 22: Ml weka

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日星期二