SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
國立臺北護理健康大學 NTUNHS
分群模型
Orozco Hsu
2022-06-06
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
分群分析
應用場景
作業
實作練習
Code
• Download code
• https://github.com/orozcohsu/ntunhs_2022_01.git
• Folder
• 20220606_mis_master/demo.ipynb
4
作業回顧
• 心臟病決策樹預測模型
5
hw03.ipynb
機器學習五個領域
6
參考:【機器學習】 - 初識機器學習 (aifreeblog.herokuapp.com)
分群分析
7
參考: 三大類機器學習:監督式、強化式、非監督式 – 工程師。日常 (wordpress.com)
分群分析
• 為一種非監督式學習,用來進行分群分析
• 事前不須要對數據進行標記
• 應用情境
• 文件分群: 結合文字探勘技術,利用斷詞後的文字做為特徵值,如分群後
的結果以人工的方式判斷某一群比較像政治類新聞,並且給予該群名稱
• 市場區隔: 透過產品的特徵值進行分群,分群的結果可比較產品間的差異
• 客戶分群: 透過客戶行為擷取出特徵值,分群後的結果將客戶進行區隔,
針對不同群的客戶執行特別的行銷方案
• 生物分群: 界、門、綱、目、科、屬、種
8
分群分析
9
關鍵字: 醫療 分群分析
分群分析
10
資料整理
• 第一步
• 辨識哪些是自變數 (簡稱 X)
• 辨識哪個是應變數 (簡稱y)
• 第二步
• 查看資料型態 (類別型? 數值型?)
• 查看資料是否有遺缺值 (該如何處理遺缺值 ?)
• 類別型用最大出現值替補 ?
• 數值型用中位數替補 ?
• 還是用演算法替補 (例如: KNN-Imputation)
11
參考: ML02: 初探遺失值(missing value)處理 | Medium
資料整理
• 第三步
• 敘述型統計 (最大值、最小值、平均值等等)
• 搭配視覺化觀察資料分佈
• 第四部
• 對於數據範圍敏感的演算法,進行欄位值的縮放 (scale)
• StandardScaler (平均值和標準差)
• MinMaxScaler(最小最大值標準化)
• MaxAbsScaler(絕對值最大標準化)
• RobustScaler (增強式標準化)
12
資料整理
• 進行欄位值轉換,採用 dummy variable (啞變量/虛擬變量)
• 針對無順序、且多分類值的欄位
• 例如: 血型 (A, B, O, AB) 分別轉換成代碼 [1,2,3,4]後,因為有從小到大的順序關係,
因此不適合這樣轉換
• 轉換範例 (會增加n-1個欄位)
13
標準化
• StandardScaler
• 以常態分佈方式進行
• 欄位值的平均值為0
• 欄位值方差(變異數)為1
• 適用於有些欄位的方差過大
• MinMaxScaler
• 欄位值的最小值為0
• 欄位值的最大值為1
• 欄位值會縮放到到[0,1]之間
14
標準化
• MaxAbsScaler
• MaxAbsScaler 與 MinMaxScaler 類似
• 所有欄位值都會除以該欄位值的絕對值後的最大值
• 欄位值會縮放到到[-1,1]之間
• RobustScaler
• 有效的縮放帶有outlier的欄位值
• 若欄位值含有異常值也會在縮放中會捨去
15
K-means
• 為非監督式學習一種
• 不需要準備數據標記
16
參考: https://zhuanlan.zhihu.com/p/97510390
K-means
• 資料演算過程
• https://www.youtube.com/watch?v=hzGnnx0k6es 17
群數: K
質心:Centroids
1. 先預設K個質心
2. 陸續讀取資料,並計算資料與各質心的距離後,
調整質心位置
3. 直到所有讀取所有資料後,距離不再大幅度變化為止
PCA 降維
18
• 需計算的欄位太多,增加bias之外,也降低了分群效果
• 降維技術就是減少計算欄位,透過欄位之間存在的線性關係
• 如: 客戶年齡、收入、消費三個欄位,收入高消費才高
• 欄位間若存在非線性關係,可用另外一個演算法 t-SNE
參考: 資料降維與視覺化:t-SNE 理論與應用 | Mr. Opengate (mropengate.blogspot.com)
19
推薦系統
• 常見推薦系統的應用
• 影片推薦 (Netflix)
• 音樂推薦 (Spotify)
• 電商推薦 (Amazon, 淘寶)
• 文章推薦 (Yahoo新聞網)
• 社交媒體 (FB)
• 廣告推薦 (Google)
• 遊戲推薦 (Steam)
20
推薦系統
• 透過分群分析,找出一群
相似的人,之後定義每一
群的樣貌
• 如果你像某一群人,進行
該群適合的推薦
21
實作練習
• 為慢性腎臟病資料集
• 透過一系列檢查,如: X光、
腎臟超音波、腎臟切片等
為協助疾病的診斷
22
demo.ipynb
參考: 慢性腎臟病:定義、原因、症狀、診斷、治療 - Hello 醫師 (helloyishi.com.tw)
作業
• 針對課堂的 CKD 資料集,完成分群後,進行各群的分析,並提
出該群的描述
• 建議仿造P.20的樣貌展示
• 文字描述
• 視覺化描述
23

Contenu connexe

Similaire à 2_學院碩士班_分群模型_20220606.pdf

以使用者為中心的設計概念跟方法(Inside salon)
以使用者為中心的設計概念跟方法(Inside salon)以使用者為中心的設計概念跟方法(Inside salon)
以使用者為中心的設計概念跟方法(Inside salon)悠識學院
 
Decision tree
Decision treeDecision tree
Decision treeFEG
 
啟動你的AI工匠魂
啟動你的AI工匠魂啟動你的AI工匠魂
啟動你的AI工匠魂Erhwen Kuo
 
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227Bluer Wang(王小红)
 
51 cto linuxops_issue2
51 cto linuxops_issue251 cto linuxops_issue2
51 cto linuxops_issue2Yiwei Ma
 
數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用基欽 劉
 
IT445_Week_11.pdf
IT445_Week_11.pdfIT445_Week_11.pdf
IT445_Week_11.pdfAiondBdkpt
 
Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01
Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01
Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01Jackie Liu
 
Introduction to postgresql community
Introduction to postgresql communityIntroduction to postgresql community
Introduction to postgresql communityGaly Lee
 
From Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent WorldFrom Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent WorldHuawei Technologies
 
網路2.0時代情報蒐集術
網路2.0時代情報蒐集術網路2.0時代情報蒐集術
網路2.0時代情報蒐集術基欽 劉
 
Realtime analytics with Flink and Druid
Realtime analytics with Flink and DruidRealtime analytics with Flink and Druid
Realtime analytics with Flink and DruidErhwen Kuo
 
Azurebootcamp 2018
Azurebootcamp 2018Azurebootcamp 2018
Azurebootcamp 2018Ian Chen
 
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)Rick Hwang
 
Linux运维趋势 第13期 服务器优化
Linux运维趋势 第13期 服务器优化Linux运维趋势 第13期 服务器优化
Linux运维趋势 第13期 服务器优化51CTO
 
Linux运维趋势 第13期 服务器优化(最终版)
Linux运维趋势 第13期 服务器优化(最终版)Linux运维趋势 第13期 服务器优化(最终版)
Linux运维趋势 第13期 服务器优化(最终版)51CTO
 
HP41- 令人迷惑的使用者研究方法 (蔡明哲)
HP41- 令人迷惑的使用者研究方法 (蔡明哲)HP41- 令人迷惑的使用者研究方法 (蔡明哲)
HP41- 令人迷惑的使用者研究方法 (蔡明哲)悠識學院
 
How to run an AI Project @pixnet
How to run an AI Project @pixnetHow to run an AI Project @pixnet
How to run an AI Project @pixnet晨揚 施
 
信息系统架构设计
信息系统架构设计信息系统架构设计
信息系统架构设计Weijun Zhong
 

Similaire à 2_學院碩士班_分群模型_20220606.pdf (20)

Data Pipeline Matters
Data Pipeline MattersData Pipeline Matters
Data Pipeline Matters
 
以使用者為中心的設計概念跟方法(Inside salon)
以使用者為中心的設計概念跟方法(Inside salon)以使用者為中心的設計概念跟方法(Inside salon)
以使用者為中心的設計概念跟方法(Inside salon)
 
Decision tree
Decision treeDecision tree
Decision tree
 
啟動你的AI工匠魂
啟動你的AI工匠魂啟動你的AI工匠魂
啟動你的AI工匠魂
 
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
 
51 cto linuxops_issue2
51 cto linuxops_issue251 cto linuxops_issue2
51 cto linuxops_issue2
 
數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用
 
IT445_Week_11.pdf
IT445_Week_11.pdfIT445_Week_11.pdf
IT445_Week_11.pdf
 
Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01
Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01
Sbir 海量運算的雲端學習歷程與評量分析app開發0124簡報v2.01
 
Introduction to postgresql community
Introduction to postgresql communityIntroduction to postgresql community
Introduction to postgresql community
 
From Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent WorldFrom Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent World
 
網路2.0時代情報蒐集術
網路2.0時代情報蒐集術網路2.0時代情報蒐集術
網路2.0時代情報蒐集術
 
Realtime analytics with Flink and Druid
Realtime analytics with Flink and DruidRealtime analytics with Flink and Druid
Realtime analytics with Flink and Druid
 
Azurebootcamp 2018
Azurebootcamp 2018Azurebootcamp 2018
Azurebootcamp 2018
 
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)
 
Linux运维趋势 第13期 服务器优化
Linux运维趋势 第13期 服务器优化Linux运维趋势 第13期 服务器优化
Linux运维趋势 第13期 服务器优化
 
Linux运维趋势 第13期 服务器优化(最终版)
Linux运维趋势 第13期 服务器优化(最终版)Linux运维趋势 第13期 服务器优化(最终版)
Linux运维趋势 第13期 服务器优化(最终版)
 
HP41- 令人迷惑的使用者研究方法 (蔡明哲)
HP41- 令人迷惑的使用者研究方法 (蔡明哲)HP41- 令人迷惑的使用者研究方法 (蔡明哲)
HP41- 令人迷惑的使用者研究方法 (蔡明哲)
 
How to run an AI Project @pixnet
How to run an AI Project @pixnetHow to run an AI Project @pixnet
How to run an AI Project @pixnet
 
信息系统架构设计
信息系统架构设计信息系统架构设计
信息系统架构设计
 

Plus de FEG

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.pdfFEG
 
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdf
學院碩士班_非監督式學習_使用Orange3直接使用_分群_20240417.pdfFEG
 
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdf
資料視覺化_透過Orange3進行_無須寫程式直接使用_碩士學程_202403.pdfFEG
 
Pytorch cnn netowork introduction 20240318
Pytorch cnn netowork introduction 20240318Pytorch cnn netowork introduction 20240318
Pytorch cnn netowork introduction 20240318FEG
 
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 practicesFEG
 
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 scratchFEG
 
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 scratchFEG
 
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 scratchFEG
 
2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_Rules2023 Supervised_Learning_Association_Rules
2023 Supervised_Learning_Association_RulesFEG
 
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 VisualizationFEG
 
Transfer Learning (20230516)
Transfer Learning (20230516)Transfer Learning (20230516)
Transfer Learning (20230516)FEG
 
Image Classification (20230411)
Image Classification (20230411)Image Classification (20230411)
Image Classification (20230411)FEG
 
Google CoLab (20230321)
Google CoLab (20230321)Google CoLab (20230321)
Google CoLab (20230321)FEG
 
Supervised Learning
Supervised LearningSupervised Learning
Supervised LearningFEG
 
UnSupervised Learning Clustering
UnSupervised Learning ClusteringUnSupervised Learning Clustering
UnSupervised Learning ClusteringFEG
 
Data Visualization in Excel
Data Visualization in ExcelData Visualization in Excel
Data Visualization in ExcelFEG
 
6_Association_rule_碩士班第六次.pdf
6_Association_rule_碩士班第六次.pdf6_Association_rule_碩士班第六次.pdf
6_Association_rule_碩士班第六次.pdfFEG
 
5_Neural_network_碩士班第五次.pdf
5_Neural_network_碩士班第五次.pdf5_Neural_network_碩士班第五次.pdf
5_Neural_network_碩士班第五次.pdfFEG
 
5_BERT.pdf
5_BERT.pdf5_BERT.pdf
5_BERT.pdfFEG
 

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_學院碩士班_分群模型_20220606.pdf