SlideShare a Scribd company logo
資料視覺化
Orozco Hsu
2024-10-15
1
About me
• Education
• NCU (MIS)、NCCU (CS)
• Experiences
• Telecom big data Innovation
• Retail Media Network (RMN)
• Customer Data Platform (CDP)
• Know-your-customer (KYC)
• Digital Transformation
• Research
• Data Ops (ML Ops)
• Business Data Analysis, AI
2
Tutorial
Content
3
EDA process
資料視覺化
作業
建立環境
Code
• Download code
• https://github.com/orozcohsu/ntunhs_2024_01.git
• Folder
• 20241015
4
建立環境
• Anaconda on Windows
• https://www.anaconda.com/products/distribution
• Python 3.9/64-Bit Graphical Installer/594 MB
• Miniconda on Windows
• https://docs.conda.io/en/latest/miniconda.html
5
記得打勾
建立環境
• 進入命令提示字元
6
建立環境
• 切換執行環境
7
建立環境
• 安裝套件
• pip install seaborn
• pip install numpy
• pip install pandas
• pip install openpyxl
• pip install jupyterlab
8
建立環境
• 開啟 jupyterlab
9
10
參考: https://commons.wikimedia.org/wiki/File:Data_visualization_process_v1.png
EDA process
• 當我們拿到資料集,如何進行下一步? EDA 就是第一步
• EDA 有助於我們了解資料樣貌
• 總資料筆數、遺缺值比例、遺缺值處理方式、欄位值分布、欄位值合理
性(business domain)
• EDA 有助於事後模型預測
• 進行處理 (normalization與standardization)
11
EDA is an approach to analyzing datasets to summarize their main characteristics,
often with visual methods (wikipedia)
EDA process
• 進行 EDA (敘述型統計)
• 檢視資料集
• 檢查資料筆數與欄位型態
• 檢查是否有不合理的空值
• 檢查是否有不合理的重複值
• 針對數值型欄位繪圖 (以單變量、多變量方式進行)
• 針對類別型欄位繪圖
• 若存在時間關係,針對日、月、年維度與頻次繪圖
12
透過 pandas 套件進行資料整理、操作,更方便進行 EDA
檢視資料集 (使用 pandas 套件的 dataframe)
13
資料集欄位型態
• 主要區分為文字、數字
• 不同型態會有占用不同的記憶體空間
資料集樣貌
• 包含 (索引、欄位名稱)
Dataframe 資料型態
14
參考: https://pbpython.com/pandas_dtypes.html
練習
16
• 請執行下列程式碼
• 學習 pandas、numpy 基本操作 (資料型態、資料存取)
pandas_dtype.ipynb
比較 python 最常見的視覺化套件
• 入門者建議由 matplotlib (seaborn) 進行
• 比較目前5大視覺化套件
• https://zhuanlan.zhihu.com/p/148748125
17
選用 seaborn
• seaborn 是基於matplotlib的圖形視覺化 python套件
• 在 matplotlib 的基礎上進行了更高級的 API 封裝,提供了一種
高度交互式界面,從而使得作圖更加容易、更美觀,便於用戶能
夠做出各種有吸引力的統計圖表
• 高度相容 numpy 與 pandas
18
Data visualization (圖表類型: relplot)
• Visualizing statistical relationships
• Statistical analysis is a process of understanding how variables in a dataset
relate to each other and how those relationships depend on other variables.
• Visualization can be a core component of this process because, when data are
visualized properly, the human visual system can see trends and patterns that
indicate a relationship.
19
參考: https://www.cntofu.com/book/172/docs/10.md
Data visualization (圖表類型: relplot)
20
Outliner
探討 0 以上、以下的資料屬性
探討 Outliner 的數量與內容
趨勢
Data visualization (圖表類型: relplot)
21
Data visualization (圖表類型: relplot)
22
Data visualization (圖表類型: relplot)
23
Data visualization (圖表類型: relplot)
24
95% 信賴區間 Confidence interval (正負一個標準差之內)
kind=line
2009~2012年度銷售中位值
平均數會比中位數大,稱之為「右偏」型態、反之「左偏」
而平均數與中位數越接近時,代表分布越平均
2009~2012年度銷售平均值
Data visualization (圖表類型: relplot)
25
kind=line
疫情發生
隨著時間而變化的趨勢發展,比較前後銷售關係
Data visualization (圖表類型: relplot)
26
kind=line
Data visualization (圖表類型: relplot)
27
kind=line
col_wrap=4
產品A
產品B
產品C
運送方式
Data visualization (圖表類型: catplot)
• How to use different visual representations to show the relationship
between multiple variables in a dataset.
• We focused on cases where the main relationship was between two
numerical variables. If one of the main variables is categorical
(divided into discrete groups) it may be helpful to use a more
specialized approach to visualization
28
參考: https://www.cntofu.com/book/172/docs/13.md
Data visualization (圖表類型: catplot)
29
Data visualization (圖表類型: catplot)
30
Data visualization (圖表類型: catplot)
31
kind=box
左偏
右偏
Data visualization (圖表類型: catplot)
32
kind=box
Data visualization (圖表類型: catplot)
33
參考: Python 箱型圖/小提琴圖(Box/Violin Plot) - Wayne's Talk (waynestalk.com)
顯示出機率密度
(資料出現的機率)
Data visualization (圖表類型: catplot)
34
kind=violin
比較之間的胖瘦
Data visualization (圖表類型: catplot)
35
kind=bar
平均值
信賴區間
Data visualization (圖表類型: catplot)
36
kind=bar
Data visualization (圖表類型: catplot)
37
kind=point
Data visualization (圖表類型: catplot)
38
kind=point
Data visualization (圖表類型: displot)
• What range do the observations cover?
• Are they heavily skewness/kurtosis?
• Is there evidence for bimodality (雙峰)?
39
參考: https://www.cntofu.com/book/172/docs/24.md
雙峰 skewness 與 kurtosis 的計算?
Data visualization (圖表類型: distplot)
40
右偏
補充: 從分布到修正,目的是為了「建模」
• 監督式學習
• 假設樣本資料為常態分佈
• 分監督式學習
• 分群的邊界拉開,讓分群效果更好
• 當資料為單峰偏斜,可以考慮採用變數轉換
• https://unaettie.com/zh-tw/pz/transform_xplain.php
41
Data visualization (圖表類型: jointplot)
• Draw a plot of two variables with bivariate and univariate graphs.
42
Data visualization (圖表類型: jointplot)
43
數量分布
Data visualization (圖表類型: jointplot)
44
數量分布
練習
• 請執行下列程式碼
45
visualization.ipynb
作業(1)
• 練習 pandas 資料操作,請參考下列連結
• https://pandas.pydata.org/docs/user_guide/10min.html
• 開啟 hw01.ipynb,完成作業
46
作業(2)
• 請透過 20241015_HW.csv 進行視覺化資料分析
47

More Related Content

PDF
2023 Data visualization using Python from scratch
FEG
 
PDF
2_學院碩士班_資料視覺化_20220411_0509.pdf
FEG
 
PPTX
精密工業智能製造:破繭重生的數位轉型之旅。主要是簡單介紹何謂智能製造,從市場趨勢、相關技術、組織改造、未來發展來說明。
twliau1
 
PDF
High Throughput Computing Technologies
Jazz Yao-Tsung Wang
 
PPT
創新管理 雲端協同商務平台 V2.5
yaohung
 
PDF
Spirent_securityLab-服務介紹_2022.pdf
ssuserdfa916
 
PDF
Operation_research_Linear_programming_20241112.pdf
FEG
 
PPT
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
Bluer Wang(王小红)
 
2023 Data visualization using Python from scratch
FEG
 
2_學院碩士班_資料視覺化_20220411_0509.pdf
FEG
 
精密工業智能製造:破繭重生的數位轉型之旅。主要是簡單介紹何謂智能製造,從市場趨勢、相關技術、組織改造、未來發展來說明。
twliau1
 
High Throughput Computing Technologies
Jazz Yao-Tsung Wang
 
創新管理 雲端協同商務平台 V2.5
yaohung
 
Spirent_securityLab-服務介紹_2022.pdf
ssuserdfa916
 
Operation_research_Linear_programming_20241112.pdf
FEG
 
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
Bluer Wang(王小红)
 

Similar to 資料視覺化_Exploation_Data_Analysis_20241015.pdf (20)

PDF
區塊鏈與金融科技(Blockchain and Fintech)
HO-HSUN LIN
 
PDF
10th.霍泰稳.info q中文站2011年技术趋势展望
drewz lin
 
PDF
Spiderweb項目簡報.pdf
Spiderweb
 
PPT
欧赛斯山丽网络整合营销提案
hpeter2002
 
PDF
云存储与虚拟化分论坛 基于云计算的海量数据挖掘
Riquelme624
 
PDF
云计算时代的新安全挑战与机会
ITband
 
PDF
13 11-08
Jazz Yao-Tsung Wang
 
PPTX
为什么选择游易帮
uehelper
 
PPT
創新管理 雲端協同商務平台 V2.0
yaohung
 
PPT
云计算可信评估方法研究
iamafan
 
PDF
非監督是學習_Kmeans_process_visualization20241110.pdf
FEG
 
PPTX
團隊協作實戰DDD
Jed Lin
 
PDF
淺談台灣巨量資料產業供應鏈串聯現況
Jazz Yao-Tsung Wang
 
PPT
386 涂家网 互联网家装设计、造价平台
Rui (Nash) Yang
 
PPT
软件工程
bill0077
 
PDF
03 李实恭-乘云之势以智致远 0611
ikewu83
 
PDF
The design and implementation of an automated platform to verify trading prog...
HsuChiaEn
 
PDF
SRE Study Notes - CH2,3,4
Rick Hwang
 
PPTX
H3C_Cloud_CMP_Multi-Cloud_Management_Platform_Features_and_Overview_Documenta...
megalodon000
 
PDF
Leverage Modern Enterprise Architecture To Speed Up Work Resumption
Denodo
 
區塊鏈與金融科技(Blockchain and Fintech)
HO-HSUN LIN
 
10th.霍泰稳.info q中文站2011年技术趋势展望
drewz lin
 
Spiderweb項目簡報.pdf
Spiderweb
 
欧赛斯山丽网络整合营销提案
hpeter2002
 
云存储与虚拟化分论坛 基于云计算的海量数据挖掘
Riquelme624
 
云计算时代的新安全挑战与机会
ITband
 
为什么选择游易帮
uehelper
 
創新管理 雲端協同商務平台 V2.0
yaohung
 
云计算可信评估方法研究
iamafan
 
非監督是學習_Kmeans_process_visualization20241110.pdf
FEG
 
團隊協作實戰DDD
Jed Lin
 
淺談台灣巨量資料產業供應鏈串聯現況
Jazz Yao-Tsung Wang
 
386 涂家网 互联网家装设计、造价平台
Rui (Nash) Yang
 
软件工程
bill0077
 
03 李实恭-乘云之势以智致远 0611
ikewu83
 
The design and implementation of an automated platform to verify trading prog...
HsuChiaEn
 
SRE Study Notes - CH2,3,4
Rick Hwang
 
H3C_Cloud_CMP_Multi-Cloud_Management_Platform_Features_and_Overview_Documenta...
megalodon000
 
Leverage Modern Enterprise Architecture To Speed Up Work Resumption
Denodo
 
Ad

More from FEG (20)

PDF
Supervised learning in decision tree algorithm
FEG
 
PDF
Unsupervised learning in data clustering
FEG
 
PDF
CNN_Image Classification for deep learning.pdf
FEG
 
PDF
Sequence Model with practicing hands on coding.pdf
FEG
 
PDF
Seq2seq Model introduction with practicing hands on coding.pdf
FEG
 
PDF
AIGEN introduction with practicing hands on coding.pdf
FEG
 
PDF
Operation_research_Linear_programming_20241015.pdf
FEG
 
PDF
Sequence Model pytorch at colab with gpu.pdf
FEG
 
PDF
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
FEG
 
PDF
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
FEG
 
PDF
Pytorch cnn netowork introduction 20240318
FEG
 
PDF
2023 Decision Tree analysis in business practices
FEG
 
PDF
2023 Clustering analysis using Python from scratch
FEG
 
PDF
2023 Supervised Learning for Orange3 from scratch
FEG
 
PDF
2023 Supervised_Learning_Association_Rules
FEG
 
PDF
202312 Exploration Data Analysis Visualization (English version)
FEG
 
PDF
202312 Exploration of Data Analysis Visualization
FEG
 
PDF
Transfer Learning (20230516)
FEG
 
PDF
Image Classification (20230411)
FEG
 
PDF
Google CoLab (20230321)
FEG
 
Supervised learning in decision tree algorithm
FEG
 
Unsupervised learning in data clustering
FEG
 
CNN_Image Classification for deep learning.pdf
FEG
 
Sequence Model with practicing hands on coding.pdf
FEG
 
Seq2seq Model introduction with practicing hands on coding.pdf
FEG
 
AIGEN introduction with practicing hands on coding.pdf
FEG
 
Operation_research_Linear_programming_20241015.pdf
FEG
 
Sequence Model pytorch at colab with gpu.pdf
FEG
 
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
FEG
 
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
FEG
 
Pytorch cnn netowork introduction 20240318
FEG
 
2023 Decision Tree analysis in business practices
FEG
 
2023 Clustering analysis using Python from scratch
FEG
 
2023 Supervised Learning for Orange3 from scratch
FEG
 
2023 Supervised_Learning_Association_Rules
FEG
 
202312 Exploration Data Analysis Visualization (English version)
FEG
 
202312 Exploration of Data Analysis Visualization
FEG
 
Transfer Learning (20230516)
FEG
 
Image Classification (20230411)
FEG
 
Google CoLab (20230321)
FEG
 
Ad

資料視覺化_Exploation_Data_Analysis_20241015.pdf