SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
國立臺北護理健康大學 NTUNHS
Clustering
Orozco Hsu
2022-11-04
1
About me
• Education
• NCU (MIS)、NCCU (CS)
• Work Experience
• Telecom big data Innovation
• AI projects
• Retail marketing technology
• User Group
• TW Spark User Group
• TW Hadoop User Group
• Taiwan Data Engineer Association Director
• Research
• Big Data/ ML/ AIOT/ AI Columnist
2
Tutorial
Content
3
To C 的應用(廣告受眾)
模型後續維護
Homework
Clustering and K-means
Code
• Download code
• https://github.com/orozcohsu/ntunhs_2022_02.git
• Folder
• 20221104
4
建立環境
• 切換執行環境
5
建立環境
• 安裝套件
• pip install scikit-learn
• pip install seaborn
6
建立環境
• 開啟 jupyterlab
7
Clustering introduction
• 為一種非監督式學習,用來解決分群問題
• 事前不須要對數據進行標記
• 何謂標記?
8
Clustering introduction
• 資料散佈圖
9
K-means
• 為非監督式學習一種
• 不需要準備數據標記
10
參考: https://zhuanlan.zhihu.com/p/97510390
K-means
• 演算法步驟
• 定義K值,決定分群數目
• 隨機給各K群中心點,計算所有訓練樣本,把每個訓練樣本分配到距離最
近的K群當中
• 移動各K群的中心點,讓該中心點為該群所有樣本距離和的平均處
• 重複上述動作,直到中心點不再移動為止
• https://www.youtube.com/watch?v=5I3Ei69I40s
11
K-means
• 受到初始值和離群值的影響,造成分群結果不穩定
• 盡量選擇均衡的樣本數據集
• 需要預設分群數量
• 分群質心不一定是樣本數據集
12
受眾分群
• 受眾分群的概念來自於一個較籠統的定義「市場區隔Market
Segmentation」
• 顧名思是就是將您的目標受眾分成不同群組,並根據這些族群對
他們量身定做不同的內容
13
受眾分群
• 取得更好的廣告效果
• 與受眾相關性越高的訊息,越容易得到更高的回覆,就可以獲得更多點
擊和轉化
• 優化訊息成功到達率
• 缺乏細分而導致訊息濫發的結果,就是該信件會被歸類到垃圾郵件,或
者被退訂,而影響了訊息的傳達率
• 建立更穩固的關係
• 分群投遞能夠讓該受眾感受到,這個內容是專為他們撰寫的,除了可以
建立對品牌的信任,也可以轉化為更忠實的顧客增加回購率
• 更加了解受眾
• 受眾分群的過程有助於加深受眾的了解
14
受眾分群
• 敘述型統計觀察每一群的變數
分布
• 年紀區間
• 性別分布
• 居住地分布
• …
• 依照業務邏輯,命名每一群的
名稱(Labeling)
• 用於名單操作
15
分群模型的操作? 資料的更新方式?
• Re-fresh
• 相同變數欄位,僅資料內容更新
• 沿用相同的分群質心,取得最新的分群名單 (請注意! 沿用原本分群定義)
• Re-model
• 有新的變數產生,需要重頭建模一次,也就是產生一個全新的模型
• 取得最新的分群質心並儲存,下次更新分群名單時使用
16
Iris 資料集
• 4個自變數
• 1個應變數(標記)
17
作業
• 什麼是 K-means? 基本迭代步驟是什麼?
• 繼續完成 keman_iris.ipynb,完成各群敘述型統計檢視
18

Contenu connexe

Similaire à 2_Clustering.pdf

Similaire à 2_Clustering.pdf (20)

03 azure devops pipeline - release
03 azure devops pipeline - release03 azure devops pipeline - release
03 azure devops pipeline - release
 
DevOps的神鬼奇航
DevOps的神鬼奇航DevOps的神鬼奇航
DevOps的神鬼奇航
 
02 azure devops pipeline - build
02 azure devops pipeline - build02 azure devops pipeline - build
02 azure devops pipeline - build
 
Where We Are Today with Deep Learning and Kubernetes - KEUC2017(Shanghai)
Where We Are Today with Deep Learning and Kubernetes - KEUC2017(Shanghai)Where We Are Today with Deep Learning and Kubernetes - KEUC2017(Shanghai)
Where We Are Today with Deep Learning and Kubernetes - KEUC2017(Shanghai)
 
Report 106553012 - copy
Report 106553012 - copyReport 106553012 - copy
Report 106553012 - copy
 
微服務架構 導入經驗分享 吳剛志 - Community Open Camp
微服務架構 導入經驗分享 吳剛志 - Community Open Camp微服務架構 導入經驗分享 吳剛志 - Community Open Camp
微服務架構 導入經驗分享 吳剛志 - Community Open Camp
 
20150206 aic machine learning
20150206 aic machine learning20150206 aic machine learning
20150206 aic machine learning
 
01 DevOps and Azure DevOps overview
01 DevOps and Azure DevOps overview01 DevOps and Azure DevOps overview
01 DevOps and Azure DevOps overview
 
Maker to startup v1.2 4 27-2016-s
Maker to startup v1.2 4 27-2016-sMaker to startup v1.2 4 27-2016-s
Maker to startup v1.2 4 27-2016-s
 
Weic2015 docker
Weic2015 dockerWeic2015 docker
Weic2015 docker
 
我們與Azure DevOps的距離
我們與Azure DevOps的距離我們與Azure DevOps的距離
我們與Azure DevOps的距離
 
The Development and Prospect of Deploying Cloud-Native O-RAN.pdf
The Development and Prospect of Deploying Cloud-Native O-RAN.pdfThe Development and Prospect of Deploying Cloud-Native O-RAN.pdf
The Development and Prospect of Deploying Cloud-Native O-RAN.pdf
 
如何使用微軟Power系列服務的看法
如何使用微軟Power系列服務的看法如何使用微軟Power系列服務的看法
如何使用微軟Power系列服務的看法
 
美团技术沙龙04 美团下一代分布式存储系统
美团技术沙龙04   美团下一代分布式存储系统美团技术沙龙04   美团下一代分布式存储系统
美团技术沙龙04 美团下一代分布式存储系统
 
玩轉 .NET Interactive Notebooks 一次就上手
玩轉 .NET Interactive Notebooks 一次就上手玩轉 .NET Interactive Notebooks 一次就上手
玩轉 .NET Interactive Notebooks 一次就上手
 
Kubernetes on gcp
Kubernetes on gcpKubernetes on gcp
Kubernetes on gcp
 
20141128(刘胜)UTC2014分布式和云服务的思考与实践——支付清算行业分布式架构的探索
20141128(刘胜)UTC2014分布式和云服务的思考与实践——支付清算行业分布式架构的探索20141128(刘胜)UTC2014分布式和云服务的思考与实践——支付清算行业分布式架构的探索
20141128(刘胜)UTC2014分布式和云服务的思考与实践——支付清算行业分布式架构的探索
 
2016 CAVEDU物聯網應用發表會 - 開場
2016 CAVEDU物聯網應用發表會 - 開場2016 CAVEDU物聯網應用發表會 - 開場
2016 CAVEDU物聯網應用發表會 - 開場
 
俞晨杰:Linked in大数据应用和azkaban
俞晨杰:Linked in大数据应用和azkaban俞晨杰:Linked in大数据应用和azkaban
俞晨杰:Linked in大数据应用和azkaban
 
4 association rule
4 association rule4 association rule
4 association rule
 

Plus de FEG

資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
FEG
 
2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules
FEG
 
202312 Exploration Data Analysis Visualization (English version)
202312 Exploration Data Analysis Visualization (English version)202312 Exploration Data Analysis Visualization (English version)
202312 Exploration Data Analysis Visualization (English version)
FEG
 
202312 Exploration of Data Analysis Visualization
202312 Exploration of Data Analysis Visualization202312 Exploration of Data Analysis Visualization
202312 Exploration of Data Analysis Visualization
FEG
 

Plus de FEG (20)

Sequence Model pytorch at colab with gpu.pdf
Sequence Model pytorch at colab with gpu.pdfSequence Model pytorch at colab with gpu.pdf
Sequence Model pytorch at colab with gpu.pdf
 
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
 
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
 
Pytorch cnn netowork introduction 20240318
Pytorch cnn netowork introduction 20240318Pytorch cnn netowork introduction 20240318
Pytorch cnn netowork introduction 20240318
 
2023 Decision Tree analysis in business practices
2023 Decision Tree analysis in business practices2023 Decision Tree analysis in business practices
2023 Decision Tree analysis in business practices
 
2023 Clustering analysis using Python from scratch
2023 Clustering analysis using Python from scratch2023 Clustering analysis using Python from scratch
2023 Clustering analysis using Python from scratch
 
2023 Data visualization using Python from scratch
2023 Data visualization using Python from scratch2023 Data visualization using Python from scratch
2023 Data visualization using Python from scratch
 
2023 Supervised Learning for Orange3 from scratch
2023 Supervised Learning for Orange3 from scratch2023 Supervised Learning for Orange3 from scratch
2023 Supervised Learning for Orange3 from scratch
 
2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules
 
202312 Exploration Data Analysis Visualization (English version)
202312 Exploration Data Analysis Visualization (English version)202312 Exploration Data Analysis Visualization (English version)
202312 Exploration Data Analysis Visualization (English version)
 
202312 Exploration of Data Analysis Visualization
202312 Exploration of Data Analysis Visualization202312 Exploration of Data Analysis Visualization
202312 Exploration of Data Analysis Visualization
 
Transfer Learning (20230516)
Transfer Learning (20230516)Transfer Learning (20230516)
Transfer Learning (20230516)
 
Image Classification (20230411)
Image Classification (20230411)Image Classification (20230411)
Image Classification (20230411)
 
Google CoLab (20230321)
Google CoLab (20230321)Google CoLab (20230321)
Google CoLab (20230321)
 
Supervised Learning
Supervised LearningSupervised Learning
Supervised Learning
 
UnSupervised Learning Clustering
UnSupervised Learning ClusteringUnSupervised Learning Clustering
UnSupervised Learning Clustering
 
Data Visualization in Excel
Data Visualization in ExcelData Visualization in Excel
Data Visualization in Excel
 
6_Association_rule_碩士班第六次.pdf
6_Association_rule_碩士班第六次.pdf6_Association_rule_碩士班第六次.pdf
6_Association_rule_碩士班第六次.pdf
 
5_Neural_network_碩士班第五次.pdf
5_Neural_network_碩士班第五次.pdf5_Neural_network_碩士班第五次.pdf
5_Neural_network_碩士班第五次.pdf
 
5_BERT.pdf
5_BERT.pdf5_BERT.pdf
5_BERT.pdf
 

2_Clustering.pdf