Practical Data Science 

Use-cases in Retail & eCommerce
By Eakasit Pacharawongsakda, Ph.D.
Co-founder of Data Cube
eakasit@datacubeth.ai
Data Analytics Sharing @Home
26 April 2020 1:30-4:30 pm
http://dataminingtrend.com http://facebook.com/datacube.th
สรุปการบริจาคเพื่อเข้าร่วมสัมมา
2
จำนวนผู้บริจาค
171
ยอดเงินบริจาคให้โรงพยาบาล/มูลนิธิ
91,021.38
http://facebook.com/datacube.thhttp://www.datacubeth.ai
About Data Cube
3
Founded on
2013
http://facebook.com/datacube.thhttp://www.datacubeth.ai
About Data Cube
4
Founded on
2013
Focused on training/implementation related to

Data Science / AI
Machine Learning / 

Big Data
http://facebook.com/datacube.thhttp://www.datacubeth.ai
About Data Cube
5
Founded on
2013
100+public/in-house

training classes
Focused on training/implementation related to

Data Science / AI
Machine Learning / 

Big Data
http://facebook.com/datacube.thhttp://www.datacubeth.ai
About Data Cube
6
Founded on
2013
100+public/in-house

training classes
40,000+people like Facebook page
Focused on training/implementation related to

Data Science / AI
Machine Learning / 

Big Data
http://dataminingtrend.com http://facebook.com/datacube.th
Our Experiences
7
Retail
• บริษัทขายสินค้า
ทางโทรศัพท์ที่เปิด
มานานกว่า 20 ปี
• สำนักพิมพ์ที่ขาย
นิยายวัยรุ่นอันดับ
หนึ่งของเมืองไทย
• บริษัทที่ขาย
โทรศัพท์มือถือ
และมีสาขา
มากมายและเปิด
มามากกว่า 30 ปี
Real Estate
• บริษัท
อสังหาริมทรัพย์
แนวหน้าของ
ประเทศไทย
Energy 

Company
• บริษัทที่ให้
บริการปั๊มน้ำมัน
ที่ใหญ่เป็นอันดับ
2 ของ
ประเทศไทย
Financial

Company
• ธนาคารของรัฐที่
กำกับดูแลสถาบัน
การเงินอื่นๆ ใน
ประเทศไทย
• ธนาคารเอกชน

อันดับต้นๆ ของ
เมืองไทย
• บริษัทบริหารและ
ติดตามหนี้สิน
practice without theory is blind”
“Theory without practice is empty,
— Kant
“ถ้ารู้ทฤษฎีแต่ขาดการปฏิบัติก็ทำงานไม่ได้

ถ้ารู้แต่ปฏิบัติไม่รู้ทฤษฎีก็พัฒนาต่อไม่ได้”
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data is a new oil
• “เมื่อข้อมูลมีค่าดั่งน้ำมัน”
9Source: https://www.raconteur.net/technology/drilling-for-new-oil-of-big-data
Customer
Data
Transaction

Data
Website
Data
Survey

Data
Social
Network 

Data Employee

Data
Reports
Actionable
Insight
Predictive
Model
Recommended
Products
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Example Data
10
ชื่อ
นามสกุล
วัน เดือน ปีเกิด
เบอร์โทรศัพท์
เพศ
ชื่อ
นามสกุล
วัน เดือน ปีเกิด
เบอร์โทรศัพท์
เพศ
ปิติ มานี
มีความสุขยินดี
ชาย
28 สิงหาคม 2545
0891234567
หญิง
22 มิถุนายน 2545
0898765432
ข้อมูลลูกค้า ข้อมูลการซื้อสินค้า
สรุปยอดขายร้าน A
สรุปยอดขายร้าน B
สรุปยอดขายร้าน C
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data Storage & Analytics
11
ฝ่ายขาย
ฝ่ายการตลาด
ฝ่ายบัญชี
http://dataminingtrend.com http://facebook.com/datacube.th
Data Storage & Analytics
12
Extract

Transform

Load

(ETL)
ฝ่ายขาย
ฝ่ายการตลาด
ฝ่ายบัญชี
http://dataminingtrend.com http://facebook.com/datacube.th
Data Storage & Analytics
13
Extract

Transform

Load

(ETL)
คลังข้อมูล
Shop Month Year Total
A 01 2018 10,650
B 01 2018 2,000
C 01 2018 29,300
… … … …
ฝ่ายขาย
ฝ่ายการตลาด
ฝ่ายบัญชี
http://dataminingtrend.com http://facebook.com/datacube.th
Data Storage & Analytics
14
Extract

Transform

Load

(ETL)
Business
Intelligence
A B C
01/2018
10,650
2,000
29,300
Shop Month Year Total
A 01 2018 10,650
B 01 2018 2,000
C 01 2018 29,300
… … … …
ฝ่ายขาย
ฝ่ายการตลาด
ฝ่ายบัญชี
คลังข้อมูล
http://dataminingtrend.com http://facebook.com/datacube.th
Data Storage & Analytics
15
Extract

Transform

Load

(ETL)
Business
Intelligence
A B C
01/2018
10,650
2,000
29,300
Data Mining
2016
2017
2018
Shop Month Year Total
A 01 2018 10,650
B 01 2018 2,000
C 01 2018 29,300
… … … …
ฝ่ายขาย
ฝ่ายการตลาด
ฝ่ายบัญชี
คลังข้อมูล
facebook.com/datacube.th
+
http://www.datacubeth.ai http://facebook.com/datacube.th
Database & warehouse & mining
• Database
• ฐานข้อมูลใช้ในการจัดเก็บข้อมูล ลดความซ้ำซ้อนของข้อมูล เน้นการจัดเก็บ เพ่ิม
แก้ไข และลบข้อมูล
• Data Warehouse
• คลังข้อมูลรวบรวมช้อมูลจากหลายๆ ฐานข้อมูล แปลงข้อมูลให้มีความเหมือนกัน
เหมาะสำหรับการเรียกดู (view) เพื่อสร้างรายงานสรุป
• Data Mining
• การวิเคราะห์ข้อมูลเพื่อค้นหาความสัมพันธ์หรือรูปแบบที่มีประโยชน์ในฐานข้อมูล
16
http://www.datacubeth.ai http://facebook.com/datacube.th
BI & Data Mining
17
Business
Intelligence
Data
Mining
Time
Analytical 

Approach
Past Future
Explanatory
Exploratory
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?
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Level of Analytics
18
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Level of Analytics
• Descriptive Analytics
• ระยะทาง 48 km
• Diagnostic Analytics
• มีการจราจรติดขัด
• Predictive Analytics
• ใช้เวลาการเดินทาง 54-56 นาที
• Prescriptive Analytics
• เมื่อขับรถไปแล้วจะมีการแนะนำเส้น
ทางอื่นที่เร็วกว่า
19
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
CRISP-DM:Cross-Industry Process for Data Mining
20
1 2
3
4
5
6
image source: Foster Provost, Data Science for Business: What you need to know about data mining and data-analytic thinking, August 19, 2013
3 ขั้นตอนแรกจะใช้เวลา
80% ของทั้งหมด
http://dataminingtrend.com http://facebook.com/datacube.th
CRISP-DM
21
STAGE DESCRIPTION
Business Understanding Define the project.
Data Understanding Examine the data; identify problems in the data.
Data Preparation Fix problems in the data; create derived variables.
Modeling Build predictive or descriptive models.
Evaluation Assess models; report on the expected effects of models.
Deployment Plan for use of models.
source: Applied Predictive Analytics: Principle and Techniques for the Professional Data Analyst
http://dataminingtrend.com http://facebook.com/datacube.th
Practical Guideline
22
“Start small and pick just one program 

and build on that success”
Reference: Predictive Marketing
— said by Elif Oner, Mavi’s head of CRM
“เริ่มจากการทำสิ่งเล็กๆ ให้สำเร็จก่อน 

[แล้วจะได้รับความเชื่อใจในภายหน้า]”
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Data Science Use Cases
23
• Churn Prevention
• Identify customers likely to leave, take
preventative action.
• Customer Lifetime Value
• Distinguish between customers based on
business value.
• Customer Segmentation
• Create meaningful customer groups for
more relevant interactions.
• Demand Forecasting
• Know what volumes to expect to improve
planning.
• Fraud Detection
• Identify fraudulent activity quickly, and
end it.
• Next Best Action
• The right action at the right time for the
right customer.
• Price Optimization
• Set prices that balance demand, profit,
and risk.
• Product Propensity
• Predict what your customers will buy,
before even they know it.
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Data Science Use Cases
24
• Text Mining
• Extract insight from unstructured content.
• Next Best Action
• The right action at the right time for the
right customer.
• Price Optimization
• Set prices that balance demand, profit,
and risk.
• Product Propensity
• Predict what your customers will buy,
before even they know it.
• Quality Assurance
• Resolve quality issues before they
become a problem.
• Predictive Maintenance
• Predict equipment failure, plan cost-
effective maintenance.
• Risk Management
• Understand risk to manage it.

• Up- and Cross-Selling
• Convince customers to buy more.

facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Banking ManufacturingTelecommunication
Data Science Use Cases
25
Retail InsuranceUse Cases
Churn Prevention
Customer Lifetime Value
Customer Segmentation
Next Best Action
Product Propensity
Up- and Cross-Selling
Demand Forecasting
Price Optimization
Risk Management
Fraud Detection
Quality Assurance
Predictive Maintenance
Text Mining
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data Science objectives
26
“There are 2 possible ways in which 

profitability of a business can grow
— by increasing revenues or decreasing cost"
Increase
Revenue
Reduce
Cost
Reference: Predictive Analytics for Marketers
“การทำให้ธุรกิจเติบโตมี 2 แนวทาง คือ 

การเพิ่มรายได้หรือการลดต้นทุน”
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data
• ข้อมูลลูกค้า
27
ชื่อ
นามสกุล
วัน เดือน ปีเกิด
เบอร์โทรศัพท์
เพศ
ปิติ
ยินดี
ชาย
28 สิงหาคม 2545
0891234567
Customer ID Name Surname Gender Birthdate
D2018-0001 ปิติ ยินดี ชาย 28/08/2545
ข้อมูลลูกค้า
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data
• ข้อมูลลูกค้า
28
Customer ID Name Surname Gender Birthdate
D2018-0001 ปิติ ยินดี ชาย 28/08/2545
D2018-0002 มานี มีความสุข หญิง 22/06/2545
D2018-0003 ชูใจ ไปดี หญิง 12/05/2545
ชื่อ
นามสกุล
วัน เดือน ปีเกิด
เบอร์โทรศัพท์
เพศ
ปิติ
ยินดี
ชาย
28 สิงหาคม 2545
0891234567
ชื่อ
นามสกุล
วัน เดือน ปีเกิด
เบอร์โทรศัพท์
เพศ
มานี
มีความสุข
หญิง
22 มิถุนายน 2545
0898765432
ชื่อ
นามสกุล
วัน เดือน ปีเกิด
เบอร์โทรศัพท์
เพศ
มานี
มีความสุข
หญิง
22 มิถุนายน 2545
0898765432
ข้อมูลลูกค้า
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data
• ข้อมูลการซื้อสินค้า
29
ใบเสร็จการซื้อสินค้า
Inv. No Date Product ID Price Cust. ID
2020001 31-01-2020 00100 100 18101
2020001 31-01-2020 00150 150 18101
2020001 31-01-2020 00182 200 18101
2020001 31-01-2020 00185 250 18101
ตารางเก็บข้อมูลการซื้อสินค้า
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data Storage
• ข้อมูลยอดขายแต่ละสาขา
30
ใบเสร็จการซื้อสินค้า
ใบเสร็จการซื้อสินค้า
Inv. No Date Product ID Price Cust. ID
2020001 31-01-2020 00100 100 18101
2020001 31-01-2020 00150 150 18101
2020001 31-01-2020 00182 200 18101
2020001 31-01-2020 00185 250 18101
2020002 02-02-2020 00150 150 18102
2020002 02-02-2020 00182 200 18102
2020002 02-02-2020 00185 250 18102
ตารางเก็บข้อมูลการซื้อสินค้า
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data Storage
• ข้อมูลยอดขายแต่ละสาขา
31
ใบเสร็จการซื้อสินค้า
ใบเสร็จการซื้อสินค้า
Inv. No Date Product ID Price Cust. ID
2020001 31-01-2020 00100 100 18101
2020001 31-01-2020 00150 150 18101
2020001 31-01-2020 00182 200 18101
2020001 31-01-2020 00185 250 18101
2020002 02-02-2020 00150 150 18102
2020002 02-02-2020 00182 200 18102
2020002 02-02-2020 00185 250 18102
2020003 03-02-2020 00100 100 18101
2020003 03-02-2020 00150 150 18101
2020003 03-02-2020 00182 200 18101
2020003 03-02-2020 00185 250 18101
ใบเสร็จการซื้อสินค้า
ตารางเก็บข้อมูลการซื้อสินค้า
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Data
• ตัวอย่างการเชื่อมโยงข้อมูล
32
Customers
Customer_ID
Name
Surname
Gender
Birthdate
Orders
Customer_ID
Branch_ID
Product_ID
Price
Date
Branches
Branch_ID
Location
Province
Products
Product ID
Name
Unit
Price
Detail
http://dataminingtrend.com http://facebook.com/datacube.th
Data Preparation
• เนื่องจากการซื้อสินค้า 1 ครั้งมีการซื้อได้มากกว่า 1 ชนิด ทำให้กระจายเป็นหลายแถว
• ต้องรวมให้เป็นการซื้อสินค้า 1 ครั้งเป็น 1 แถว
33
Inv. No Date Product ID Price Cust. ID
2020001 31-01-2020 00100 100 18101
2020001 31-01-2020 00150 150 18101
2020001 31-01-2020 00182 200 18101
2020001 31-01-2020 00185 250 18101
2020002 02-02-2020 00150 150 18102
2020002 02-02-2020 00182 200 18102
2020002 02-02-2020 00185 250 18102
2020003 03-02-2020 00100 100 18101
2020003 03-02-2020 00150 150 18101
2020003 03-02-2020 00182 200 18101
2020003 03-02-2020 00185 250 18101
Inv. No Date Sum(Price) Cust. ID
2020001 31-01-2020 700 18101
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data Preparation
• เนื่องจากการซื้อสินค้า 1 ครั้งมีการซื้อได้มากกว่า 1 ชนิด ทำให้กระจายเป็นหลายแถว
• ต้องรวมให้เป็นการซื้อสินค้า 1 ครั้งเป็น 1 แถว
34
Inv. No Date Product ID Price Cust. ID
2020001 31-01-2020 00100 100 18101
2020001 31-01-2020 00150 150 18101
2020001 31-01-2020 00182 200 18101
2020001 31-01-2020 00185 250 18101
2020002 02-02-2020 00150 150 18102
2020002 02-02-2020 00182 200 18102
2020002 02-02-2020 00185 250 18102
2020003 03-02-2020 00100 100 18101
2020003 03-02-2020 00150 150 18101
2020003 03-02-2020 00182 200 18101
2020003 03-02-2020 00185 250 18101
Inv. No Date Sum(Price) Cust. ID
2020001 31-01-2020 700 18101
2020002 02-02-2020 600 18102
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Data Preparation
• เนื่องจากการซื้อสินค้า 1 ครั้งมีการซื้อได้มากกว่า 1 ชนิด ทำให้กระจายเป็นหลายแถว
• ต้องรวมให้เป็นการซื้อสินค้า 1 ครั้งเป็น 1 แถว
35
Inv. No Date Product ID Price Cust. ID
2020001 31-01-2020 00100 100 18101
2020001 31-01-2020 00150 150 18101
2020001 31-01-2020 00182 200 18101
2020001 31-01-2020 00185 250 18101
2020002 02-02-2020 00150 150 18102
2020002 02-02-2020 00182 200 18102
2020002 02-02-2020 00185 250 18102
2020003 03-02-2020 00100 100 18101
2020003 03-02-2020 00150 150 18101
2020003 03-02-2020 00182 200 18101
2020003 03-02-2020 00185 250 18101
Inv. No Date Sum(Price) Cust. ID
2020001 31-01-2020 700 18101
2020002 02-02-2020 600 18102
2020003 03-02-2020 700 18101
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Data Preparation
• สร้าง customer profile และสร้างตัวแปร (variable) ใหม่
36
Inv. No Date Sum(Price) Cust. ID
2020001 31-01-2020 700 18101
2020002 02-02-2020 600 18102
2020003 03-02-2020 700 18101
Count by 

Customer ID
Customer ID Count
18101 2
18102 1
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Data Preparation
• สร้าง customer profile และสร้างตัวแปร (variable) ใหม่
37
Inv. No Date Sum(Price) Cust. ID
2020001 31-01-2020 700 18101
2020002 02-02-2020 600 18102
2020003 03-02-2020 700 18101
Count by 

Customer ID
Customer ID Count
18101 2
18102 1
Sum price
Customer ID Sum(Sum(Price)
18101 1,400
18102 600
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Data Preparation
• สร้าง customer profile และสร้างตัวแปร (variable) ใหม่
38
Inv. No Date Sum(Price) Cust. ID
2020001 31-01-2020 700 18101
2020002 02-02-2020 600 18102
2020003 03-02-2020 700 18101
Count by 

Customer ID
Customer ID Count (Cust.ID)
18101 2
18102 1
Lastest Date
Customer ID Max(Date)
18101 03-02-2020
18102 02-02-2020
Sum price
Customer ID Sum(Sum(Price)
18101 1,400
18102 600
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Data Preparation
• สร้าง customer profile และสร้างตัวแปร (variable) ใหม่
39
Customer ID Count
18101 2
18102 1
Customer ID Max(Date)
18101 03-02-2020
18102 02-02-2020
Customer ID Sum(Sum(Price)
18101 1,400
18102 600
+ +
=
Customer ID Count(Customer ID) Max(Date) Sum(Sum(Price)
18101 2 03-03-2020 1,400
18102 1 02-02-2020 600
http://dataminingtrend.com http://facebook.com/datacube.th
Data Preparation
• จากการซื้ิอหนึ่งครั้ง จะได้
• ใครคือคนซื่้อ
• เวลาที่ซื้อ
• วันที่ซื้อ
• ที่อยู่
• เพศ (อาจจะดูจากคำนำหน้าชื่อ)
• จำนวนที่ซื้อ
• สี ประเภทของสินค้า
• ราคาที่ซื้อ
• เป็นการซื้อครั้งแรกหรือซื้อซ้ำ
• ซื้อสินค้าเต็มราคาหรือลดราคา
• ซื้อห่างจากคราวก่อนกี่วัน
• เลือกการส่งสินค้าแบบไหน
• ช่องทางการซื้อสินค้า
40
Inv. No Date Product ID Price Cust. ID
2020001 31-01-2020 00100 100 18101
2020001 31-01-2020 00150 150 18101
2020001 31-01-2020 00182 200 18101
2020001 31-01-2020 00185 250 18101
2020002 02-02-2020 00150 150 18102
2020002 02-02-2020 00182 200 18102
2020002 02-02-2020 00185 250 18102
2020003 03-02-2020 00100 100 18101
2020003 03-02-2020 00150 150 18101
2020003 03-02-2020 00182 200 18101
2020003 03-02-2020 00185 250 18101
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Example Use Cases
41
ข้อมูล transaction
รายงานช่วงเวลาการขายสินค้า
D/T 08:00 09:00 10:00
M
T
W
Th
Customer Segmentation
$$$
$$$$
$$$
$
$$
Product RecommendationPropensity to BuyDemand Forecast
Jan Feb Mar Apr May
10,000
15,000
20,000
25,000
30,000
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• ช่วงเวลาที่ขายสินค้าได้ดี
42
data source: https://www.kaggle.com/ashydv/online-retail-store
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• ช่วงเวลาที่ขายสินค้าได้ดี
43
data source: https://www.kaggle.com/ashydv/online-retail-store
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• ช่วงเวลาที่ขายสินค้าได้ดี
44
data source: https://www.kaggle.com/ashydv/online-retail-store
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• Customer Segmentation
45
data source: https://www.kaggle.com/ashydv/online-retail-store
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• Product Recommendation
46
data source: generated from RapidMiner Studio 9
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• Product Recommendation
47
data source: generated from RapidMiner Studio 9
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• Propensity to Buy
48
data source: generated from RapidMiner Studio 9
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• Propensity to Buy
49
data source: generated from RapidMiner Studio 9
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• Demand Forecasting
50
data source: generated from RapidMiner Studio 9
facebook.com/datacube.th
http://facebook.com/datacube.thhttp://www.datacubeth.ai
Example Use Cases
• Demand Forecasting
51
data source: generated from RapidMiner Studio 9
facebook.com/datacube.th
http://dataminingtrend.com http://facebook.com/datacube.th
Skills for success
52
Technical Skills
Database
Data Preparation
Data Warehouse
Business Intelligence
Data Mining
Data Science
Machine Learning
Statistics
Soft Skills
Data Visualization
Storytelling with data
Communication
PresentationX
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@datacubeth.ai
• lineID: eakasitp
53

Practical Data Science 
Use-cases in Retail & eCommerce

  • 1.
    Practical Data Science
 Use-cases in Retail & eCommerce By Eakasit Pacharawongsakda, Ph.D. Co-founder of Data Cube eakasit@datacubeth.ai Data Analytics Sharing @Home 26 April 2020 1:30-4:30 pm
  • 2.
  • 3.
  • 4.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai About Data Cube 4 Foundedon 2013 Focused on training/implementation related to
 Data Science / AI Machine Learning / 
 Big Data
  • 5.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai About Data Cube 5 Foundedon 2013 100+public/in-house
 training classes Focused on training/implementation related to
 Data Science / AI Machine Learning / 
 Big Data
  • 6.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai About Data Cube 6 Foundedon 2013 100+public/in-house
 training classes 40,000+people like Facebook page Focused on training/implementation related to
 Data Science / AI Machine Learning / 
 Big Data
  • 7.
    http://dataminingtrend.com http://facebook.com/datacube.th Our Experiences 7 Retail •บริษัทขายสินค้า ทางโทรศัพท์ที่เปิด มานานกว่า 20 ปี • สำนักพิมพ์ที่ขาย นิยายวัยรุ่นอันดับ หนึ่งของเมืองไทย • บริษัทที่ขาย โทรศัพท์มือถือ และมีสาขา มากมายและเปิด มามากกว่า 30 ปี Real Estate • บริษัท อสังหาริมทรัพย์ แนวหน้าของ ประเทศไทย Energy 
 Company • บริษัทที่ให้ บริการปั๊มน้ำมัน ที่ใหญ่เป็นอันดับ 2 ของ ประเทศไทย Financial
 Company • ธนาคารของรัฐที่ กำกับดูแลสถาบัน การเงินอื่นๆ ใน ประเทศไทย • ธนาคารเอกชน
 อันดับต้นๆ ของ เมืองไทย • บริษัทบริหารและ ติดตามหนี้สิน
  • 8.
    practice without theoryis blind” “Theory without practice is empty, — Kant “ถ้ารู้ทฤษฎีแต่ขาดการปฏิบัติก็ทำงานไม่ได้
 ถ้ารู้แต่ปฏิบัติไม่รู้ทฤษฎีก็พัฒนาต่อไม่ได้” facebook.com/datacube.th
  • 9.
    http://dataminingtrend.com http://facebook.com/datacube.th Data isa new oil • “เมื่อข้อมูลมีค่าดั่งน้ำมัน” 9Source: https://www.raconteur.net/technology/drilling-for-new-oil-of-big-data Customer Data Transaction
 Data Website Data Survey
 Data Social Network 
 Data Employee
 Data Reports Actionable Insight Predictive Model Recommended Products facebook.com/datacube.th
  • 10.
    http://dataminingtrend.com http://facebook.com/datacube.th Example Data 10 ชื่อ นามสกุล วันเดือน ปีเกิด เบอร์โทรศัพท์ เพศ ชื่อ นามสกุล วัน เดือน ปีเกิด เบอร์โทรศัพท์ เพศ ปิติ มานี มีความสุขยินดี ชาย 28 สิงหาคม 2545 0891234567 หญิง 22 มิถุนายน 2545 0898765432 ข้อมูลลูกค้า ข้อมูลการซื้อสินค้า สรุปยอดขายร้าน A สรุปยอดขายร้าน B สรุปยอดขายร้าน C facebook.com/datacube.th
  • 11.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Storage& Analytics 11 ฝ่ายขาย ฝ่ายการตลาด ฝ่ายบัญชี
  • 12.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Storage& Analytics 12 Extract
 Transform
 Load
 (ETL) ฝ่ายขาย ฝ่ายการตลาด ฝ่ายบัญชี
  • 13.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Storage& Analytics 13 Extract
 Transform
 Load
 (ETL) คลังข้อมูล Shop Month Year Total A 01 2018 10,650 B 01 2018 2,000 C 01 2018 29,300 … … … … ฝ่ายขาย ฝ่ายการตลาด ฝ่ายบัญชี
  • 14.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Storage& Analytics 14 Extract
 Transform
 Load
 (ETL) Business Intelligence A B C 01/2018 10,650 2,000 29,300 Shop Month Year Total A 01 2018 10,650 B 01 2018 2,000 C 01 2018 29,300 … … … … ฝ่ายขาย ฝ่ายการตลาด ฝ่ายบัญชี คลังข้อมูล
  • 15.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Storage& Analytics 15 Extract
 Transform
 Load
 (ETL) Business Intelligence A B C 01/2018 10,650 2,000 29,300 Data Mining 2016 2017 2018 Shop Month Year Total A 01 2018 10,650 B 01 2018 2,000 C 01 2018 29,300 … … … … ฝ่ายขาย ฝ่ายการตลาด ฝ่ายบัญชี คลังข้อมูล facebook.com/datacube.th +
  • 16.
    http://www.datacubeth.ai http://facebook.com/datacube.th Database &warehouse & mining • Database • ฐานข้อมูลใช้ในการจัดเก็บข้อมูล ลดความซ้ำซ้อนของข้อมูล เน้นการจัดเก็บ เพ่ิม แก้ไข และลบข้อมูล • Data Warehouse • คลังข้อมูลรวบรวมช้อมูลจากหลายๆ ฐานข้อมูล แปลงข้อมูลให้มีความเหมือนกัน เหมาะสำหรับการเรียกดู (view) เพื่อสร้างรายงานสรุป • Data Mining • การวิเคราะห์ข้อมูลเพื่อค้นหาความสัมพันธ์หรือรูปแบบที่มีประโยชน์ในฐานข้อมูล 16
  • 17.
    http://www.datacubeth.ai http://facebook.com/datacube.th BI &Data Mining 17 Business Intelligence Data Mining Time Analytical 
 Approach Past Future Explanatory Exploratory 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? facebook.com/datacube.th
  • 18.
  • 19.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Level of Analytics •Descriptive Analytics • ระยะทาง 48 km • Diagnostic Analytics • มีการจราจรติดขัด • Predictive Analytics • ใช้เวลาการเดินทาง 54-56 นาที • Prescriptive Analytics • เมื่อขับรถไปแล้วจะมีการแนะนำเส้น ทางอื่นที่เร็วกว่า 19 facebook.com/datacube.th
  • 20.
    http://dataminingtrend.com http://facebook.com/datacube.th CRISP-DM:Cross-Industry Processfor Data Mining 20 1 2 3 4 5 6 image source: Foster Provost, Data Science for Business: What you need to know about data mining and data-analytic thinking, August 19, 2013 3 ขั้นตอนแรกจะใช้เวลา 80% ของทั้งหมด
  • 21.
    http://dataminingtrend.com http://facebook.com/datacube.th CRISP-DM 21 STAGE DESCRIPTION BusinessUnderstanding Define the project. Data Understanding Examine the data; identify problems in the data. Data Preparation Fix problems in the data; create derived variables. Modeling Build predictive or descriptive models. Evaluation Assess models; report on the expected effects of models. Deployment Plan for use of models. source: Applied Predictive Analytics: Principle and Techniques for the Professional Data Analyst
  • 22.
    http://dataminingtrend.com http://facebook.com/datacube.th Practical Guideline 22 “Startsmall and pick just one program 
 and build on that success” Reference: Predictive Marketing — said by Elif Oner, Mavi’s head of CRM “เริ่มจากการทำสิ่งเล็กๆ ให้สำเร็จก่อน 
 [แล้วจะได้รับความเชื่อใจในภายหน้า]” facebook.com/datacube.th
  • 23.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Data Science UseCases 23 • Churn Prevention • Identify customers likely to leave, take preventative action. • Customer Lifetime Value • Distinguish between customers based on business value. • Customer Segmentation • Create meaningful customer groups for more relevant interactions. • Demand Forecasting • Know what volumes to expect to improve planning. • Fraud Detection • Identify fraudulent activity quickly, and end it. • Next Best Action • The right action at the right time for the right customer. • Price Optimization • Set prices that balance demand, profit, and risk. • Product Propensity • Predict what your customers will buy, before even they know it. facebook.com/datacube.th
  • 24.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Data Science UseCases 24 • Text Mining • Extract insight from unstructured content. • Next Best Action • The right action at the right time for the right customer. • Price Optimization • Set prices that balance demand, profit, and risk. • Product Propensity • Predict what your customers will buy, before even they know it. • Quality Assurance • Resolve quality issues before they become a problem. • Predictive Maintenance • Predict equipment failure, plan cost- effective maintenance. • Risk Management • Understand risk to manage it.
 • Up- and Cross-Selling • Convince customers to buy more.
 facebook.com/datacube.th
  • 25.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Banking ManufacturingTelecommunication Data ScienceUse Cases 25 Retail InsuranceUse Cases Churn Prevention Customer Lifetime Value Customer Segmentation Next Best Action Product Propensity Up- and Cross-Selling Demand Forecasting Price Optimization Risk Management Fraud Detection Quality Assurance Predictive Maintenance Text Mining facebook.com/datacube.th
  • 26.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Scienceobjectives 26 “There are 2 possible ways in which 
 profitability of a business can grow — by increasing revenues or decreasing cost" Increase Revenue Reduce Cost Reference: Predictive Analytics for Marketers “การทำให้ธุรกิจเติบโตมี 2 แนวทาง คือ 
 การเพิ่มรายได้หรือการลดต้นทุน” facebook.com/datacube.th
  • 27.
    http://dataminingtrend.com http://facebook.com/datacube.th Data • ข้อมูลลูกค้า 27 ชื่อ นามสกุล วันเดือน ปีเกิด เบอร์โทรศัพท์ เพศ ปิติ ยินดี ชาย 28 สิงหาคม 2545 0891234567 Customer ID Name Surname Gender Birthdate D2018-0001 ปิติ ยินดี ชาย 28/08/2545 ข้อมูลลูกค้า facebook.com/datacube.th
  • 28.
    http://dataminingtrend.com http://facebook.com/datacube.th Data • ข้อมูลลูกค้า 28 CustomerID Name Surname Gender Birthdate D2018-0001 ปิติ ยินดี ชาย 28/08/2545 D2018-0002 มานี มีความสุข หญิง 22/06/2545 D2018-0003 ชูใจ ไปดี หญิง 12/05/2545 ชื่อ นามสกุล วัน เดือน ปีเกิด เบอร์โทรศัพท์ เพศ ปิติ ยินดี ชาย 28 สิงหาคม 2545 0891234567 ชื่อ นามสกุล วัน เดือน ปีเกิด เบอร์โทรศัพท์ เพศ มานี มีความสุข หญิง 22 มิถุนายน 2545 0898765432 ชื่อ นามสกุล วัน เดือน ปีเกิด เบอร์โทรศัพท์ เพศ มานี มีความสุข หญิง 22 มิถุนายน 2545 0898765432 ข้อมูลลูกค้า facebook.com/datacube.th
  • 29.
    http://dataminingtrend.com http://facebook.com/datacube.th Data • ข้อมูลการซื้อสินค้า 29 ใบเสร็จการซื้อสินค้า Inv.No Date Product ID Price Cust. ID 2020001 31-01-2020 00100 100 18101 2020001 31-01-2020 00150 150 18101 2020001 31-01-2020 00182 200 18101 2020001 31-01-2020 00185 250 18101 ตารางเก็บข้อมูลการซื้อสินค้า facebook.com/datacube.th
  • 30.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Storage •ข้อมูลยอดขายแต่ละสาขา 30 ใบเสร็จการซื้อสินค้า ใบเสร็จการซื้อสินค้า Inv. No Date Product ID Price Cust. ID 2020001 31-01-2020 00100 100 18101 2020001 31-01-2020 00150 150 18101 2020001 31-01-2020 00182 200 18101 2020001 31-01-2020 00185 250 18101 2020002 02-02-2020 00150 150 18102 2020002 02-02-2020 00182 200 18102 2020002 02-02-2020 00185 250 18102 ตารางเก็บข้อมูลการซื้อสินค้า facebook.com/datacube.th
  • 31.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Storage •ข้อมูลยอดขายแต่ละสาขา 31 ใบเสร็จการซื้อสินค้า ใบเสร็จการซื้อสินค้า Inv. No Date Product ID Price Cust. ID 2020001 31-01-2020 00100 100 18101 2020001 31-01-2020 00150 150 18101 2020001 31-01-2020 00182 200 18101 2020001 31-01-2020 00185 250 18101 2020002 02-02-2020 00150 150 18102 2020002 02-02-2020 00182 200 18102 2020002 02-02-2020 00185 250 18102 2020003 03-02-2020 00100 100 18101 2020003 03-02-2020 00150 150 18101 2020003 03-02-2020 00182 200 18101 2020003 03-02-2020 00185 250 18101 ใบเสร็จการซื้อสินค้า ตารางเก็บข้อมูลการซื้อสินค้า facebook.com/datacube.th
  • 32.
  • 33.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Preparation •เนื่องจากการซื้อสินค้า 1 ครั้งมีการซื้อได้มากกว่า 1 ชนิด ทำให้กระจายเป็นหลายแถว • ต้องรวมให้เป็นการซื้อสินค้า 1 ครั้งเป็น 1 แถว 33 Inv. No Date Product ID Price Cust. ID 2020001 31-01-2020 00100 100 18101 2020001 31-01-2020 00150 150 18101 2020001 31-01-2020 00182 200 18101 2020001 31-01-2020 00185 250 18101 2020002 02-02-2020 00150 150 18102 2020002 02-02-2020 00182 200 18102 2020002 02-02-2020 00185 250 18102 2020003 03-02-2020 00100 100 18101 2020003 03-02-2020 00150 150 18101 2020003 03-02-2020 00182 200 18101 2020003 03-02-2020 00185 250 18101 Inv. No Date Sum(Price) Cust. ID 2020001 31-01-2020 700 18101 facebook.com/datacube.th
  • 34.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Preparation •เนื่องจากการซื้อสินค้า 1 ครั้งมีการซื้อได้มากกว่า 1 ชนิด ทำให้กระจายเป็นหลายแถว • ต้องรวมให้เป็นการซื้อสินค้า 1 ครั้งเป็น 1 แถว 34 Inv. No Date Product ID Price Cust. ID 2020001 31-01-2020 00100 100 18101 2020001 31-01-2020 00150 150 18101 2020001 31-01-2020 00182 200 18101 2020001 31-01-2020 00185 250 18101 2020002 02-02-2020 00150 150 18102 2020002 02-02-2020 00182 200 18102 2020002 02-02-2020 00185 250 18102 2020003 03-02-2020 00100 100 18101 2020003 03-02-2020 00150 150 18101 2020003 03-02-2020 00182 200 18101 2020003 03-02-2020 00185 250 18101 Inv. No Date Sum(Price) Cust. ID 2020001 31-01-2020 700 18101 2020002 02-02-2020 600 18102 facebook.com/datacube.th
  • 35.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Preparation •เนื่องจากการซื้อสินค้า 1 ครั้งมีการซื้อได้มากกว่า 1 ชนิด ทำให้กระจายเป็นหลายแถว • ต้องรวมให้เป็นการซื้อสินค้า 1 ครั้งเป็น 1 แถว 35 Inv. No Date Product ID Price Cust. ID 2020001 31-01-2020 00100 100 18101 2020001 31-01-2020 00150 150 18101 2020001 31-01-2020 00182 200 18101 2020001 31-01-2020 00185 250 18101 2020002 02-02-2020 00150 150 18102 2020002 02-02-2020 00182 200 18102 2020002 02-02-2020 00185 250 18102 2020003 03-02-2020 00100 100 18101 2020003 03-02-2020 00150 150 18101 2020003 03-02-2020 00182 200 18101 2020003 03-02-2020 00185 250 18101 Inv. No Date Sum(Price) Cust. ID 2020001 31-01-2020 700 18101 2020002 02-02-2020 600 18102 2020003 03-02-2020 700 18101 facebook.com/datacube.th
  • 36.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Data Preparation • สร้างcustomer profile และสร้างตัวแปร (variable) ใหม่ 36 Inv. No Date Sum(Price) Cust. ID 2020001 31-01-2020 700 18101 2020002 02-02-2020 600 18102 2020003 03-02-2020 700 18101 Count by 
 Customer ID Customer ID Count 18101 2 18102 1 facebook.com/datacube.th
  • 37.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Data Preparation • สร้างcustomer profile และสร้างตัวแปร (variable) ใหม่ 37 Inv. No Date Sum(Price) Cust. ID 2020001 31-01-2020 700 18101 2020002 02-02-2020 600 18102 2020003 03-02-2020 700 18101 Count by 
 Customer ID Customer ID Count 18101 2 18102 1 Sum price Customer ID Sum(Sum(Price) 18101 1,400 18102 600 facebook.com/datacube.th
  • 38.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Data Preparation • สร้างcustomer profile และสร้างตัวแปร (variable) ใหม่ 38 Inv. No Date Sum(Price) Cust. ID 2020001 31-01-2020 700 18101 2020002 02-02-2020 600 18102 2020003 03-02-2020 700 18101 Count by 
 Customer ID Customer ID Count (Cust.ID) 18101 2 18102 1 Lastest Date Customer ID Max(Date) 18101 03-02-2020 18102 02-02-2020 Sum price Customer ID Sum(Sum(Price) 18101 1,400 18102 600 facebook.com/datacube.th
  • 39.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Data Preparation • สร้างcustomer profile และสร้างตัวแปร (variable) ใหม่ 39 Customer ID Count 18101 2 18102 1 Customer ID Max(Date) 18101 03-02-2020 18102 02-02-2020 Customer ID Sum(Sum(Price) 18101 1,400 18102 600 + + = Customer ID Count(Customer ID) Max(Date) Sum(Sum(Price) 18101 2 03-03-2020 1,400 18102 1 02-02-2020 600
  • 40.
    http://dataminingtrend.com http://facebook.com/datacube.th Data Preparation •จากการซื้ิอหนึ่งครั้ง จะได้ • ใครคือคนซื่้อ • เวลาที่ซื้อ • วันที่ซื้อ • ที่อยู่ • เพศ (อาจจะดูจากคำนำหน้าชื่อ) • จำนวนที่ซื้อ • สี ประเภทของสินค้า • ราคาที่ซื้อ • เป็นการซื้อครั้งแรกหรือซื้อซ้ำ • ซื้อสินค้าเต็มราคาหรือลดราคา • ซื้อห่างจากคราวก่อนกี่วัน • เลือกการส่งสินค้าแบบไหน • ช่องทางการซื้อสินค้า 40 Inv. No Date Product ID Price Cust. ID 2020001 31-01-2020 00100 100 18101 2020001 31-01-2020 00150 150 18101 2020001 31-01-2020 00182 200 18101 2020001 31-01-2020 00185 250 18101 2020002 02-02-2020 00150 150 18102 2020002 02-02-2020 00182 200 18102 2020002 02-02-2020 00185 250 18102 2020003 03-02-2020 00100 100 18101 2020003 03-02-2020 00150 150 18101 2020003 03-02-2020 00182 200 18101 2020003 03-02-2020 00185 250 18101 facebook.com/datacube.th
  • 41.
    http://dataminingtrend.com http://facebook.com/datacube.th Example UseCases 41 ข้อมูล transaction รายงานช่วงเวลาการขายสินค้า D/T 08:00 09:00 10:00 M T W Th Customer Segmentation $$$ $$$$ $$$ $ $$ Product RecommendationPropensity to BuyDemand Forecast Jan Feb Mar Apr May 10,000 15,000 20,000 25,000 30,000 facebook.com/datacube.th
  • 42.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •ช่วงเวลาที่ขายสินค้าได้ดี 42 data source: https://www.kaggle.com/ashydv/online-retail-store
  • 43.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •ช่วงเวลาที่ขายสินค้าได้ดี 43 data source: https://www.kaggle.com/ashydv/online-retail-store
  • 44.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •ช่วงเวลาที่ขายสินค้าได้ดี 44 data source: https://www.kaggle.com/ashydv/online-retail-store facebook.com/datacube.th
  • 45.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •Customer Segmentation 45 data source: https://www.kaggle.com/ashydv/online-retail-store facebook.com/datacube.th
  • 46.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •Product Recommendation 46 data source: generated from RapidMiner Studio 9
  • 47.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •Product Recommendation 47 data source: generated from RapidMiner Studio 9 facebook.com/datacube.th
  • 48.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •Propensity to Buy 48 data source: generated from RapidMiner Studio 9 facebook.com/datacube.th
  • 49.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •Propensity to Buy 49 data source: generated from RapidMiner Studio 9 facebook.com/datacube.th
  • 50.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •Demand Forecasting 50 data source: generated from RapidMiner Studio 9 facebook.com/datacube.th
  • 51.
    http://facebook.com/datacube.thhttp://www.datacubeth.ai Example Use Cases •Demand Forecasting 51 data source: generated from RapidMiner Studio 9 facebook.com/datacube.th
  • 52.
    http://dataminingtrend.com http://facebook.com/datacube.th Skills forsuccess 52 Technical Skills Database Data Preparation Data Warehouse Business Intelligence Data Mining Data Science Machine Learning Statistics Soft Skills Data Visualization Storytelling with data Communication PresentationX
  • 53.
    http://dataminingtrend.com http://facebook.com/datacube.th For moreinformation • หสม. ดาต้า คิวบ์ (data cube) • website: http://www.dataminingtrend.com • facebook: http:facebook.com/datacube.th หรือ http://facebook.com/sit.ake • email: eakasit@datacubeth.ai • lineID: eakasitp 53