DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. ·...
Transcript of DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. ·...
![Page 1: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/1.jpg)
DATA ANALYTICS
Wanida Saetang Ph.D (candidate)King Mongkut's University of Technology North Bangkok
![Page 2: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/2.jpg)
Agenda
Data Analytics Predictive analytics
Data Mining Techniques Decision Tree K-means
Apply Model & Validation Model
Rapid Miner Studio
Workshop
![Page 3: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/3.jpg)
Data Analytics predictive analytics
![Page 4: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/4.jpg)
The Progression of Analytics
![Page 5: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/5.jpg)
Predictive Analytics
carried out in an attempt to determine the outcome of an event that might occur in the future.
the models used for predictive analytics have implicit dependencies on the conditions under which the past events occurred.
![Page 6: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/6.jpg)
Data Mining Techniques Decision tree
K-Means
![Page 7: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/7.jpg)
CRISP-DM
http://mlwiki.org/index.php/CRISP-DM
![Page 8: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/8.jpg)
ประเภทของขอมล
ประเภทขอมล
(type of data)
เชงปรมาณ(Numerical/
Quantitative Data)
Discreat Data
Continuous Data
เชงคณภาพ(Category/
Qualitative Data)
Nominal Data
Ordinal Data
ขอมลทไดจากการนบ เชน จ านวนลกคา
ชอมลทไดจากการวด เชน น าหนก, สวนสง
ขอมลทแบงออกเปนกลมๆ ไมสามารถน ามาค านวณได เชน เพศ
ขอมลทแบงออกเปนกลมๆ สามารถบอกล าดบของกลมได เชน ระดบการศกษา
![Page 9: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/9.jpg)
เทคนคเหมองขอมล
Decision Tree
Naive Bayes
Neural Network
Support Vector Machines (SVM)
K-Means
DBSCAN
EM Clustering using GMMs.
Agglomerative Hierarchical
Apriori algorithm
Eclat algorithm
FP-growth algorithm
![Page 10: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/10.jpg)
ClassificationDecision Tree
![Page 11: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/11.jpg)
Decision Tree
ตนไมตดสนใจ (decision tree) เปนการจ าแนกกลมโดยททราบจ านวนกลมปลายทาง เปาหมายของการจ าแนก คอ ท านายคา หรอตวแปรเปาหมาย (class/label) ตนไมตดสนใจเปนเหมอนกราฟ หรอแผนผง มลกษณะเปนตนไมกลบหว ประกอบดวย Node (โหนด) โดยแตละโหนด แทนตวแปรอนพต (input attribute) ตาง ๆ ในชดขอมล และEdge (เสนเชอม) แทนคาของตวแปร (numerical attributes) โหนดบนสดเรยกวา root node หรอโหนดราก และแตกกงออกมาเปน leaf node หรอโหนดใบ
![Page 12: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/12.jpg)
Decision Tree: Information Gain
ข นตอนการสราง decision tree จะท าการค านวณเลอกแอตทรบวตทมความสมพนธกบคลาสมาใชงาน คา Information Gain สามารถค านวณไดจากสมการ ดานลางน
Information Gain = Entropy(initial) – [P(c1) × Entropy(c1) + P(c2) × Entropy(c2) + …]
โดยท Entropy(c1) = –P(c1) log 2P(c1)
และ P(c1) คอ คาความนาจะเปน (probability) ของ c1
![Page 13: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/13.jpg)
Decision Tree: spam e-mail classification
![Page 14: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/14.jpg)
Decision Tree: Information Gain
ID Type
1 spam
2 spam
5 spam
6 spam
8 spam
3 normal
4 normal
7 normal
9 normal
10 normal
P(spam) = 5/10 = 0.5P(normal) = 5/10 = 0.5Entropy (initial) = - [P(spam) × log2 P(spam) + P(normal) × log2 P(normal)]
Entropy(initial) = - [0.5 x log2 (0.5) + 0.5 x log2 (0.5)]= - [0.5 x (-1) + 0.5 x (-1) ]= 1
![Page 15: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/15.jpg)
Decision Tree: Information Gain
ID Free Type
1 Y spam
5 Y spam
6 Y spam
2 N spam
3 N normal
4 N normal
7 N normal
8 N spam
9 N normal
10 N normal
P(spam) = 3/3 = 1.0P(normal) = 0/3 = 0.0Entropy(Free = Y) = -[1.0 x log2 (1.0) + 0.0 x log2 (0.0)]
= -[1.0 x 0 + 0.0 x 0 ]= 0
P(spam) = 2/7 = 0.29P(normal) = 5/7 = 0.71Entropy(Free = N) = -[0.29 x log2 (0.29) + 0.71 x log2 (0.71)]
= -[0.29 x (-1.79) + 0.71 x (-0.49) ]= 0.87
Information Gain (Free) = Entropy(initial) – [P (Free = Y) × Entropy(Free = Y) + P(Free = N) × Entropy(Free = N) ]= 1 – [0.3 × 0 + 0.7 × 0.87]= 0.39
![Page 16: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/16.jpg)
สรางโมเดล (Classification model)
http://dataminingtrend.com/2014/data-mining-techniques/ensemble-model/
classification model
![Page 17: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/17.jpg)
ClusteringK-means
![Page 18: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/18.jpg)
Clustering การท า Clustering คอ การแบงกลมหรอจดกลมขอมล โดยไมทราบจ านวนกลมปลายทาง
ขอมลทมลกษณะคลาย ๆ กน จะอยกลมเดยวกน ขอมลทมลกษณะทแตกตางกนมาก ๆ จะถกจดใหอยคนละกลมกน โดยแตละกลมจะเรยกวา คลสเตอร (cluster)
คลสเตอร A
คลสเตอร B
คลสเตอร C
![Page 19: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/19.jpg)
Clustering
การจดขอมลใหอยในกลมตาง ๆ จะตองมการวดคาความคลายคลง (similarity) หรอคาระยะหาง (distance) ระหวางขอมลแตละตว (example)
วธการค านวณคาระยะหางทนยมใช เชน ระยะหางยคลเดยน (Euclidean distance)
P1 (x1,y1)
P2 (x2,y2)
𝐶 = 𝑥1 − 𝑥22 + 𝑦1 − 𝑦2
2
![Page 20: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/20.jpg)
Clustering
ในการท า Clustering มพารามเตอรทตองก าหนด คอ จ านวนกลมทตองการแบง หรอจ านวนคลสเตอร แทนดวยตวแปร K
ขนตอนการท างาน
1. เลอกจ านวนของคลสเตอร (K)
2. สมเลอกจดศนยกลาง (centroid) ข นมาตามจ านวนคลสเตอร
3. ก าหนดใหขอมลอยในคลสเตอรทใกลทสด
4. ค านวณหาจดศนยกลางแตละคลสเตอรใหม
5. ท าซ าขอ 3 และ 4 ซ า จนกระทง centroid ไมมการเปลยนแปลง
![Page 21: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/21.jpg)
Apply ModelValidation Model
![Page 22: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/22.jpg)
การประยกตใชโมเดล (Apply model)
http://dataminingtrend.com/2014/data-mining-techniques/ensemble-model/
สรางโมเดล
น าโมเดลไปใชงาน
![Page 23: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/23.jpg)
Validate Model
Self Consistency Test
Split-validation
Cross-validation
![Page 24: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/24.jpg)
http://dataminingtrend.com/2014/data-mining-techniques/cross-validation/
![Page 25: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/25.jpg)
http://dataminingtrend.com/2014/data-mining-techniques/cross-validation/
![Page 26: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/26.jpg)
http://dataminingtrend.com/2014/data-mining-techniques/cross-validation/
![Page 27: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/27.jpg)
http://dataminingtrend.com/2014/data-mining-techniques/cross-validation/
![Page 28: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/28.jpg)
http://dataminingtrend.com/2014/data-mining-techniques/cross-validation/
![Page 29: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/29.jpg)
http://dataminingtrend.com/2014/data-mining-techniques/cross-validation/
![Page 30: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/30.jpg)
![Page 31: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/31.jpg)
Repository
Operators
Process Parameters
Help
![Page 32: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/32.jpg)
Rapid Miner Studio
Input Ports (inp)example set (exa)training set (tra)
Output Ports (res)Output (out)model (mod) example set (exa)
![Page 33: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/33.jpg)
Workshop Decision tree
K-Means
![Page 34: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/34.jpg)
การเตรยมขอมล
Training Data Testing Data Unknown Data
![Page 35: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/35.jpg)
Preprocessing
(cleansing)
สรางโมเดล
Modeling
ประยกตใชโมเดล
Apply model
ทดสอบโมเดล
Validation
วดประสทธภาพ
โมเดล
Performance
Blending Ex. Select attributes (เลอกคอลมน)Filter examples (เลอกแถว)
Cleansing Ex. Replace missing values (เตมขอมลทเปนmissing values ดวยคาอน)
ModelingEx. Decision tree, Random Forest, k-means, Rules Induction, Deep learning
ScoringEx. Apply model
ValidationEx. Performance classification, Cluster Distance Performance
ValidationEx. Cross validation, Split validation
Modeling Process
![Page 36: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/36.jpg)
Workshop 1 Decision Tree
Lab2
Lab1
Lab3
Lab4
Validate Model
Test Model
Apply Model
Decision Tree
![Page 37: DATA ANALYTICS164.115.41.179/d756/sites/default/files/Data Analytics.pdf · 2018. 12. 25. · Apriori algorithm Eclat algorithm FP-growth algorithm. Classification Decision Tree .](https://reader036.fdocuments.us/reader036/viewer/2022062610/610e7ec9afe34b640e797f79/html5/thumbnails/37.jpg)
Workshop 2 K-means
• Lab1 K-means • Lab2 Apply Model
• Lab3 Test Model • Lab4 Validate Model