4. (data)3
base|warehouse|mining
http://dataminingtrend.com http://facebook.com/datacube.th
About us
4
RapidMiner Analyst
Certification
This is to Certify that
Successfully passed the examination for the Certified RapidMiner Analyst.
The RapidMiner Analyst certification level is designed for individuals who wish to demonstrate
a fundamental understanding of how RapidMiner software works and is used.
Certified Analyst professionals will be able to prepare data and create predictive models in
standard data environments typically found within most analyst positions.
The candidate has proven the ability to:
Prepare data Build predictive models
Evaluate the model’s quality Score new data sets
Deploy data mining models
With:
RapidMiner Studio RapidMiner Server
Eakasit Pacharawongsakda
31. http://dataminingtrend.com http://facebook.com/datacube.th
What is Big Data?
• Big Data ประกอบด้วย 3 V
• Volume
• ข้อมูลมีจำนวนเพิ่มขึ้นอย่างมหาศาล
• Velocity
• ข้อมูลเพิ่มขึ้นอย่างรวดเร็ว
• Variety
• ข้อมูลมีความหลากหลายมากขึ้น
31
source: https://upxacademy.com/beginners-guide-to-big-data/
35. http://dataminingtrend.com http://facebook.com/datacube.th
What is Big Data?
• Huge volume of data
• ข้อมูลมีขนาดใหญ่มากๆ เช่น มีจำนวนเป็นพันล้านแถว (billion row) หรือ
เป็นล้านคอลัมน์ (million columns)
• Speed of new data creation and growth
• ข้อมูลเกิดขึ้นอย่างรวดเร็วมากๆ
35
37. http://dataminingtrend.com http://facebook.com/datacube.th
What is Big Data?
• Huge volume of data
• ข้อมูลมีขนาดใหญ่มากๆ เช่น มีจำนวนเป็นพันล้านแถว (billion row) หรือ
เป็นล้านคอลัมน์ (million columns)
• Speed of new data creation and growth
• ข้อมูลเกิดขึ้นอย่างรวดเร็วมากๆ
• Complexity of data types and structures
• ข้อมูลมีความหลากหลาย ไม่ได้อยู่ในรูปแบบของตารางเท่านั้น อาจจะเป็น
รูปแบบของข้อความ (text) รูปภาพ (images) หรือ วิดีโอ (video clip)
37
53. http://dataminingtrend.com http://facebook.com/datacube.th
Big Data and traditional analytics
53
Big Data Traditional analytics
Type of data Unstructured formats
Formatted in rows and
columns
Volume of data 100 terabytes to petabytes Tens of terabytes or less
Flow of data Constant flow of data Static pool of data
Analysis method
Machine Learning/
Data Mining
Hypothesis-based
Primary purpose Data-based products
Internal decision support
and services
source: big data @ work
54. http://dataminingtrend.com http://facebook.com/datacube.th
BI & Data Science/Data Mining
54
Business
Intelligence
Data
Mining
Time
Analytical
Approach
Past Future
Explanatory
Explanatory
source:Data Science and Big Data Analytics: Discovering, analyzing, visualizing and presenting data
BI questions
• What happened last
quarter?
• How many unit sold?
• Where is the problem? In
which situations
Data Mining questions
• What if … ?
• What will happen next?
• Why is this happen?
74. http://dataminingtrend.com http://facebook.com/datacube.th
Data Science/Data Mining methods
• ตัวอย่าง spam e-mail classification
• สร้างโมเดล (classification model) จากข้อมูล training data ซึ่งมีลาเบล (label)
74
ID Free Won Cash Type
1 Y Y Y spam
2 N Y Y spam
3 N N N normal
4 N N N normal
5 Y N N spam
6 Y N N spam
7 N N N normal
8 N Y N spam
9 N N N normal
10 N N N normal
attribute label
Free
Won
Normal Spam
Spam
classification model
= N = Y
= N = Y
training data
75. http://dataminingtrend.com http://facebook.com/datacube.th
Data Science/Data Mining methods
• ตัวอย่าง spam e-mail classification
• นำข้อมูลใหม่ (unseen data) ทำนายโดยใช้โมเดล
75
attribute
Free
Won
Normal Spam
Spam
classification model
= N = Y
= N = Y
training data
ID Free Won Cash Type
11 Y Y N ?
12 N Y N ?
76. http://dataminingtrend.com http://facebook.com/datacube.th
Data Science/Data Mining methods
• ตัวอย่าง spam e-mail classification
• นำข้อมูลใหม่ (unseen data) ทำนายโดยใช้โมเดล
76
attribute
Free
Won
Normal Spam
Spam
classification model
= N = Y
= N = Y
training data
ID Free Won Cash Type
11 Y Y N ?
12 N Y N ?
77. http://dataminingtrend.com http://facebook.com/datacube.th
Data Science/Data Mining methods
• ตัวอย่าง spam e-mail classification
• นำข้อมูลใหม่ (unseen data) ทำนายโดยใช้โมเดล
77
attribute
Free
Won
Normal Spam
Spam
classification model
= N = Y
= N = Y
training data
ID Free Won Cash Type
11 Y Y N ?
12 N Y N ?
78. http://dataminingtrend.com http://facebook.com/datacube.th
• ตัวอย่าง spam e-mail classification
ID Free Won Cash Type
1 Y Y Y spam
2 N Y Y spam
3 N N N normal
4 N N N normal
5 Y N N spam
Classification example
78
attribute labelID
training data
สร้าง classification model
ID Free Won Cash Type
11 Y Y N ?
12 N Y N ?
unseen data
classification model
ID Type
11 spam
12 spam
1
2
3 4
79. http://dataminingtrend.com http://facebook.com/datacube.th
Challenges for mining Big Data
• Heterogeneous and Complex Data
• data types are varied such as Social Network data, Biological data, GIS
• data mining technique should take into the consideration relationships in
the data such as network (graph) connectivity, temporal and spatial
• Scalability
• data sets with sizes of gigabytes, terabytes are becoming common.
• data mining technique can be improved by using sampling or developing
parallel or distributed algorithms
79
91. http://dataminingtrend.com http://facebook.com/datacube.th
Text representation
• ในการวิเคราะห์ข้อมูลข้อความต้องทำการแปลงข้อมูลให้อยู่
ในรูปแบบที่มีโครงสร้าง
91
Laying on the sand sun hitting me, this feels good :)
Smells so good I have two :)
i watched 3 movies today, reminded me of my child hood! Finding Nemo
was always my favourite, but that was when i was MUCH younger! :)
I think NYC would be amazing, I really wanna go there :)
he never care,he never look at me..:(
i am so tired!! and my feet hurt :(
positive
negative
92. http://dataminingtrend.com http://facebook.com/datacube.th
Text representation: Bag of Words
• จำนวนความถี่ของคำที่เกิดขึ้นในข้อความ
92
ID Tweet Sentiment
1
Laying on the sand sun hitting
me, this feels good. positive
2 Smells so good I have two. positive
3
i watched 3 movies today,
reminded me of my child hood!
Finding Nemo was always my
favourite, but that was when i
was MUCH younger!
positive
4
I think NYC would be amazing,
I really wanna go there.
positive
5
he never care,he never look at
me.
negative
6
i am so tired!! and my feet
hurt.
negative
Term Count
Finding 1
93. http://dataminingtrend.com http://facebook.com/datacube.th
Text representation: Bag of Words
• จำนวนความถี่ของคำที่เกิดขึ้นในข้อความ
93
ID Tweet Sentiment
1
Laying on the sand sun hitting
me, this feels good. positive
2 Smells so good I have two. positive
3
i watched 3 movies today,
reminded me of my child hood!
Finding Nemo was always my
favourite, but that was when i
was MUCH younger!
positive
4
I think NYC would be amazing,
I really wanna go there.
positive
5
he never care,he never look at
me.
negative
6
i am so tired!! and my feet
hurt.
negative
Term Count
Finding 1
I 3
94. http://dataminingtrend.com http://facebook.com/datacube.th
Text representation: Bag of Words
• จำนวนความถี่ของคำที่เกิดขึ้นในข้อความ
94
ID Tweet Sentiment
1
Laying on the sand sun hitting
me, this feels good. positive
2 Smells so good I have two. positive
3
i watched 3 movies today,
reminded me of my child hood!
Finding Nemo was always my
favourite, but that was when i
was MUCH younger!
positive
4
I think NYC would be amazing,
I really wanna go there.
positive
5
he never care,he never look at
me.
negative
6
i am so tired!! and my feet
hurt.
negative
Term Count
Finding 1
I 3
Laying 1
MUCH 1
NYC 1
Nemo 1
Smells 1
always 1
am 1
amazing 1
and 1
at 1
be 1
but 1
care 1
Term Count
child 1
favourite 1
feels 1
feet 1
go 1
good 2
have 1
he 2
hitting 1
hood 1
hurt 1
i 3
look 1
me 1
… 1
bag of words
95. http://dataminingtrend.com http://facebook.com/datacube.th
Text representation: Stemming
• แปลงคำให้เป็นรากศัพท์ (root) เช่น finding แปลงเป็น find
95
Term Count
child 1
favourite 3
feels 1
feet 1
go 1
good 2
have 1
he 2
hitting 1
hood 1
hurt 1
i 3
look 1
me 1
… 1
Term Count
child 1
favourit 1
feel 1
feet 1
go 1
good 2
have 1
he 2
hit 1
hood 1
hurt 1
i 3
look 1
me 1
… 1
Term Count
Finding 1
I 3
Laying 1
MUCH 1
NYC 1
Nemo 1
Smells 1
always 1
am 1
amazing 1
and 1
at 1
be 1
but 1
care 1
Term Count
find 1
i 6
lai 1
much 1
nyc 1
nemo 1
smell 1
alwai 1
am 1
amaz 1
and 1
at 1
be 1
but 1
care 1
bag of words bag of words
96. http://dataminingtrend.com http://facebook.com/datacube.th
Text representation: Remove stopwords
• ตัดคำที่เป็น stop word ทิ้ง
96
Term Count
find 1
i 6
lai 1
much 1
nyc 1
nemo 1
smell 1
alwai 1
am 1
amaz 1
and 1
at 1
be 1
but 1
care 1
Term Count
child 1
favourit 1
feel 1
feet 1
go 1
good 2
have 1
he 2
hit 1
hood 1
hurt 1
look 1
me 1
… 1
Term Count
find 1
i 6
lai 1
nyc 1
nemo 1
smell 1
alwai 1
amaz 1
child 1
favorit 1
feel 1
feet 1
go 1
good 2
hit 1
Term Count
hood 1
hurt 1
look 1
care 1
movi 1
reali 1
remind 1
sand 1
sun 1
thi 1
think 1
tire 1
todai 1
wa 3
watch 1
remove stopwords
97. http://dataminingtrend.com http://facebook.com/datacube.th
Convert text to structured data
• Binary occurrence ถ้ามีคำที่เกิดขึ้นในแต่ละเอกสารจะให้ค่าเป็น 1
ถ้าไม่เกิดขึ้นจะเป็น 0
97
ID find I lai nyc nemo smell alwai … Sentiment
1 0 0 1 0 0 0 0 … positive
2 0 1 0 0 0 1 0 … positive
3 1 1 0 0 1 0 1 … positive
4 0 1 0 1 0 0 0 … positive
5 0 0 0 0 0 0 0 … negative
6 0 1 0 0 0 0 0 … negative
attribute label
ID Tweet Sentiment
1
Laying on the sand sun hitting
me, this feels good. positive
2 Smells so good I have two. positive
3
i watched 3 movies today,
reminded me of my child hood!
Finding Nemo was always my
favourite, but that was when i
was MUCH younger!
positive
4
I think NYC would be amazing,
I really wanna go there.
positive
5
he never care,he never look at
me.
negative
6
i am so tired!! and my feet
hurt.
negative
training data แสดงคำที่เกิดขึ้นในเอกสารต่างๆ
98. http://dataminingtrend.com http://facebook.com/datacube.th
Convert text to structured data
• Term Frequency คือจำนวนครั้งที่คำนั้นเกิดขึ้นในเอกสารทั้งหมด
• TF = จำนวนคำในเอกสาร/จำนวนคำทั้งหมดในเอกสาร
98
ID find I lai nyc nemo … Sentiment
1 0 0 0.17 0 0 … positive
2 0 0.17 0 0 0 … positive
3 0.17 0.33 0 0 0.17 … positive
4 0 0.33 0 0.17 0 … positive
5 0 0 0 0 0 … negative
6 0 0.17 0 0 0 … negative
attribute label
ID Tweet Sentiment
1
Laying on the sand sun hitting
me, this feels good. positive
2 Smells so good I have two. positive
3
i watched 3 movies today,
reminded me of my child hood!
Finding Nemo was always my
favourite, but that was when i
was MUCH younger!
positive
4
I think NYC would be amazing,
I really wanna go there.
positive
5
he never care,he never look at
me.
negative
6
i am so tired!! and my feet
hurt.
negative
training data แสดงคำที่เกิดขึ้นในเอกสารต่างๆ
99. http://dataminingtrend.com http://facebook.com/datacube.th
Handle large corpus of text data
• การนับจำนวนคำปกติจะเป็นแบบเรียงลำดับ (sequential) ทีละเอกสาร ดังนั้นถ้า
เอกสารมีจำนวนเยอะมากๆ จะทำงานได้้ช้า
• ใช้หลักการทำงานแบบขนาน (parallel) โดยใช้วิธีการของ Map/Reduce (Dean and
Ghemawat, OSDI 2004)
• Map takes an input pair and produces a set of intermediate key/value
pairs.
• จะเก็บในรูปแบบ (key1, value1) เช่น (“find”,1), (“I”,1), (“lay”,1), (“I”,1), (“I”,1)
• The Reduce function merges together values to form a possibly smaller set
of values.
• จะเก็บในรูปแบบ (key1, list(value1)) เช่น (“find“,{1}), (“I“,{1,1,1}), (“lay“,{1})
• สุดท้ายจะได้จำนวนคำ คือ (“find”,1), (“I”,3) และ (“lay”,1)
99
101. http://dataminingtrend.com http://facebook.com/datacube.th
Handle large corpus of text data
101
ID Tweet
1
Laying on the sand sun
hitting me, this feels good.
2
Smells so good I have
two.
ID Tweet
3
I watched 3 movies today,
reminded me of my child hood!
Finding Nemo was always my
favourite, but that was when I
was MUCH younger!
4
I think NYC would be amazing,
I really wanna go there.
ID Tweet
5
he never care,he never
look at me.
6
I am so tired!! and my feet
hurt.
เครื่องที่ 1 เครื่องที่ 2 เครื่องที่ 3
map step
• (“Laying”,1)
• (“on“, 1)
….
• (“I“, 1)
• (“I“,1)
• (“watched“, 1)
….
• (“I“, 1)
• (“he“,1)
• (“never“, 1)
….
• (“I“, 1)
112. http://dataminingtrend.com http://facebook.com/datacube.th
Big Data & Analytics Applications
• คาดการณ์การลาออกของพนักงาน
112
Receive Promotion
= NO = YES
Years with firm < 5
Not Quit
= YES = NO
Partner changed job
Quit Not Quit
= YES = NO
Quit
ตัวอย่างโมเดลคาดการณ์การลาออกของพนักงาน
118. http://dataminingtrend.com http://facebook.com/datacube.th
Big Data & Analytics Applications
• Business use cases
• Sales and marketing analytics
• Customer analytics
• Social media analytics
• Plant and facility management.
• Supply chain and channel analytics
• Fraud detection
• Price optimization
118
119. http://dataminingtrend.com http://facebook.com/datacube.th
Business use cases
• Sales and marketing analytics
• The first involves using analytical models to improve how customer-facing
applications make direct recommendations to the customer
• include better identifying opportunities for cross-selling and upselling
• decreasing abandoned shopping carts and generally improving the
accuracy of integrated recommendation engines
• The second type is intended to show the performance of the marketing
group's processes and campaigns and recommend adjustments to
optimize that performance.
• Analyzing which campaign addressed the needs of identified clusters or
segments
• the success ratios for motivating the campaigns' call to action.
119
120. http://dataminingtrend.com http://facebook.com/datacube.th
Business use cases
• Customer analytics
• This includes analyzing customer demographics, behaviors and
characteristics to develop models for
• segmenting customers
• predicting churn
• making next-best-offer recommendations to help with customer
retention
• Social media analytics
• The content that streams across social media channels provides ample
opportunities for analyzing customer sentiment and identifying brand risks
when negative information is promulgated about a company's products
120
121. http://dataminingtrend.com http://facebook.com/datacube.th
Business use cases
• Plant and facility management.
• As more devices and machines are Internet-enabled, organizations
are able to collect and analyze streaming sensor data indicating
continuous measures of power usage, temperature, humidity and
contaminant particles, among a myriad of potential variables.
• Models can be developed for predicting equipment failures and
scheduling pre-emptive maintenance to keep items in working order
without interruption.
121
122. http://dataminingtrend.com http://facebook.com/datacube.th
Business use cases
• Supply chain and channel analytics
• Analyzing warehouse inventory, point-of-sale transactions and
shipments via a variety of channels (e.g., trucking, rail, shipping)
results in predictive analytical models that can help with
• pre-emptive replenishment
• inventory management strategies
• logistics management
• route optimization
• notifications when delays imperil timely deliveries
122
123. http://dataminingtrend.com http://facebook.com/datacube.th
Business use cases
• Fraud detection
• An adjunct to the growing risk of identity theft is the growth of
fraudulent activity and transactions
• Financial institutions analyze billions of transactions to identify
patterns of fraudulent behavior, and the analytical models can also
trigger alerts to customers when a potential fraudulent transaction
might be taking place.
123
124. http://dataminingtrend.com http://facebook.com/datacube.th
Business use cases
• Price optimization
• Retailers looking to maximize overall profitability for product sales may
develop analytical models that combine a variety of data streams,
including competitors' prices, sales transactions across many geographic
regions (to review demand), and information on production, inventories and
the supply chain (to monitor supply).
• The resulting models can be used to dynamically adjust product prices up
when supplies are low, demand is on the increase and competitors are
unable to deliver, or down when inventory needs to be cleared as
seasonal demand shifts.
124
143. http://dataminingtrend.com http://facebook.com/datacube.th
CRISP-DM Example 1
4. Modeling
143
Computer
= HIGH = LOW
Physics
Good
Good
= LOW = HIGH
Mathematics
Good Bad
= HIGH = LOW
• IF Computer is HIGH THEN
Graduate is Good
• IF Computer is LOW AND
Mathematics is HIGH THEN
Graduate is Good
• IF Computer is LOW AND
Mathematics is LOW AND
Physics is HIGH THEN
Graduate is Good
• IF Computer is LOW AND
Mathematics is LOW AND
Physics is LOW THEN
Graduate is Bad
โมเดลของภาควิชาวิศวกรรมคอมพิวเตอร์
เงื่อนไขที่สร้างได้จากโมเดล
144. http://dataminingtrend.com http://facebook.com/datacube.th
CRISP-DM Example 1
5. Evaluation
• ทดสอบด้วยข้อมูล 30% ที่แบ่งไว้
• คำนวณค่าความถูกต้อง
6. Deployment
• นำไปแนะนำนิสิตชั้นปีที่ 1 ที่กำลัง
จะเลือกภาควิชา
• พิจารณาจากเกรดตามโมเดล
ที่สร้างได้
144
Computer
= HIGH = LOW
Physics
Good
Good
= LOW = HIGH
Mathematics
Good Bad
= HIGH = LOW
โมเดลของภาควิชาวิศวกรรมคอมพิวเตอร์
รหัสนิสิต เพศ คอมพิวเตอร์ คณิตศาสตร์ … Com Eng
5700123 ชาย LOW HIGH … ??
ข้อมูลของนักศึกษาปีที่ 1 ที่ต้องการได้รับคำแนะนำ
145. http://dataminingtrend.com http://facebook.com/datacube.th
CRISP-DM Example 1
5. Evaluation
• ทดสอบด้วยข้อมูล 30% ที่แบ่งไว้
• คำนวณค่าความถูกต้อง
6. Deployment
• นำไปแนะนำนิสิตชั้นปีที่ 1 ที่กำลัง
จะเลือกภาควิชา
• พิจารณาจากเกรดตามโมเดล
ที่สร้างได้
145
Computer
= HIGH = LOW
Physics
Good
Good
= LOW = HIGH
Mathematics
Good Bad
= HIGH = LOW
โมเดลของภาควิชาวิศวกรรมคอมพิวเตอร์
รหัสนิสิต เพศ คอมพิวเตอร์ คณิตศาสตร์ … Com Eng
5700123 ชาย LOW HIGH … ??
ข้อมูลของนักศึกษาปีที่ 1 ที่ต้องการได้รับคำแนะนำ
146. http://dataminingtrend.com http://facebook.com/datacube.th
CRISP-DM Example 1
5. Evaluation
• ทดสอบด้วยข้อมูล 30% ที่แบ่งไว้
• คำนวณค่าความถูกต้อง
6. Deployment
• นำไปแนะนำนิสิตชั้นปีที่ 1 ที่กำลัง
จะเลือกภาควิชา
• พิจารณาจากเกรดตามโมเดล
ที่สร้างได้
146
Computer
= HIGH = LOW
Physics
Good
Good
= LOW = HIGH
Mathematics
Good Bad
= HIGH = LOW
โมเดลของภาควิชาวิศวกรรมคอมพิวเตอร์
รหัสนิสิต เพศ คอมพิวเตอร์ คณิตศาสตร์ … Com Eng
5700123 ชาย LOW HIGH … ??
ข้อมูลของนักศึกษาปีที่ 1 ที่ต้องการได้รับคำแนะนำ
147. http://dataminingtrend.com http://facebook.com/datacube.th
CRISP-DM Example 1
5. Evaluation
• ทดสอบด้วยข้อมูล 30% ที่แบ่งไว้
• คำนวณค่าความถูกต้อง
6. Deployment
• นำไปแนะนำนิสิตชั้นปีที่ 1 ที่กำลัง
จะเลือกภาควิชา
• พิจารณาจากเกรดตามโมเดล
ที่สร้างได้
147
Computer
= HIGH = LOW
Physics
Good
Good
= LOW = HIGH
Mathematics
Good Bad
= HIGH = LOW
โมเดลของภาควิชาวิศวกรรมคอมพิวเตอร์
รหัสนิสิต เพศ คอมพิวเตอร์ คณิตศาสตร์ … Com Eng
5700123 ชาย LOW HIGH … Good
ข้อมูลของนักศึกษาปีที่ 1 ที่ต้องการได้รับคำแนะนำ
148. http://dataminingtrend.com http://facebook.com/datacube.th
References
• Andrew Chisholm, Exploring Data with RapidMiner, November 2013
• Markus Hofmann, Ralf Klinkenberg, RapidMiner: Data Mining Use Cases and
Business Analytics Applications, October 25, 2013
• Foster Provost, Data Science for Business: What you need to know about
data mining and data-analytic thinking, August 19, 2013
• Eakasit Pacharawongsakda, An Introduction to Data Mining Techniques (Thai
version), 2014
148
149. http://dataminingtrend.com http://facebook.com/datacube.th
For more information
• หสม. ดาต้า คิวบ์ (data cube)
• website: http://www.dataminingtrend.com
• facebook: http:facebook.com/datacube.th หรือ http://facebook.com/sit.ake
• email: eakasit@datacube.asia
• lineID: eakasitp
149