SlideShare a Scribd company logo
1 of 24
Contents
•クラスタリング
•K-means法
•階層型クラスタリング
•低次元化
•深層学習
クラスタ
•データの集まり、グループ
•なんらかの類似性をもつ
データの仲間
•位置、⼤きさ、⾊など
• データが似ているかどうかはデータ⾃体の
⼀部あるいは全成分の組合せにより定まる
ことに注意
クラスタリング
•データ集合をいくつかの
クラスタに分割すること
•クラスタリングは
教師なし学習の⼀種
正解はない
クラスタリングの役割
• データを分類することによって法則性を⾒出す。
⇒ 知識創⽣、知識獲得
• パターン認識の前段階処理。クラスタリングの結果が認
識に直結あるいは間接的に識別を助ける材料を提供する。
• ⾃ら概念を獲得するロボットをつくろうとする場合には
クラスタリングは重要な要素技術.
クラスタリングの基本⽅針
内的結合
• クラスタ内のデータは似ているべき
外的分離
• 異なるクラスタのデータ同⼠は似ていないべき
似てね?
「意味のある」クラスタリングとは?
• 特徴量や特徴ベクトルによって張られる特徴空間の設計が重要.
⇒クラスタリングの成否に大きく影響。
• クラスタリングの仕方は無数。どんな特徴を基準にどう分けるのが効果的なのか
は、突き詰めれば目的次第。
• 汎用的に意味のあることもある ⇒ 低次元化
• もし同じデータを表現できるなら次元は少なければ少ないほどよい
• クラスタリングは低次元化の一種
クラスタリング
クラスター1
クラスター2
クラスター3
クラスター1
クラスター2
クラスター3
形状
大きさ
データが(形状、大きさ)の対で表現できるならば、画像
そのものよりも、その対で表現する方がきっと効率的
クラスとクラスタの違い
•クラスは人が事前に決めたグループ、
人によって意味付けが与えられている
•クラスタは似たものを集めた結果できる
グループ、グループの意味は後から解釈され
る
特徴量抽出とクラスタリング
対象が特徴空間上の点として表されると,クラスタリングは
特徴空間上の点をグループ分けする数学的な問題になる.
セトサ
バージ
カラー
バージ
ニカ
花びらの大きさ
ガク片の大きさ
セトサ
バージ
カラー
バージ
ニカ
クラスタリング手法の分類
• 階層型クラスタリング
• 分割型 全体が1つのクラスタという状態から始めて、順次分割していき、ク
ラスタ階層を生成
• 凝集型 全データが別クラスタという状態から始めて、順次併合を繰り返して
クラスタ階層を生成
• 分割最適化クラスタリング
• クラスタの良さを表す尺度を定義し、その尺度で分割状態を最適化することに
よりデータ全体をクラスタ分割する 例)K-means法
階層型クラスタリング
の例(凝集法)
① 個々のデータのみを
含むクラスタを設定する。
c
a
d
e
b
クラスタ
データ
c
a
d
e
b
② すべてのクラスタ間
距離を測り、最も近いクラ
スタのペアを見出す
階層型クラスタリング
の例(凝集法)
③ 最も近かったクラスタ
対をまとめてひとつのクラス
タとし、あらためて距離を計
算
クラスタ
データ
④ クラスタ数が設定さ
れた数に減るまで併合処
理を繰り返す
e
b
c
a
d e
b
c
a
d e
b
c
a
d
デンドログラム
• 全体が1つのクラスタとなる
までの併合の様子を
木構造で表現したグラフ
e
b
c
a
d
cb e d a
be
bce
ad
abcd
e
併合したクラスタ
間の距離を表す
4
3
2
1
併合ステップ
クラスタ間の距離の定義法
クラスタ間の距離をどう定義して併合をすすめるか
•最短距離法 併合前の最も近いクラスタ間距離
•群平均法 併合前のクラスタのサイズに
比例した加重平均距離
•重心法 各クラスタの重心同士の距離
•メディアン法 各クラスタの中央値同士の距離
•ウォード法
併合後の分散
ー 併合前の分散の和
e
b
c
a
d
最短
重心間
例 重心法を使ってD={0,2,5,9,12,14}
のデンドログラムを作成せよ。
0 2 5 9 12 14
1 13
7/3 35/3
例 最短距離法を使って図の点集合
{A,B,C,D,E,F,G,H}のデンドログラムを作成せよ。
距離1
距離1
距離√2
距離√2
距離2
距離2
分割最適化クラスタリング
• n個のデータをk個のクラスタに分割する方法はいくつ存
在するか?
• 答え
	𝑆 𝑛, 𝑘 =
1
𝑘!
) (−1)-./ 𝐶/ 𝑚2
-
-
/34
要するにデータが増えればとてつもなく多くなるので、
総当たりはできない
k-means法 代表的な分割最適化手法
• 目的関数
• 意味
K個のクラスタの各代表を1個選び、クラスタ内各データとその代
表とのユークリッド距離の総和を全クラスタについて総和した値を
最小化するような分割法を求める
? どうやって代表を決める ?
? どうやって各データの所属クラスタを決める ?
) ) (𝑥̅- − 𝑥7)8
9:∈<=
>
-34
クラスタ内の各データについての和
全クラスタについての和
k-means法のアルゴリズム
① K個の代表点を適当に決める。
② 各データとK個の代表点の距離を測り、最も近い代表点のクラスタ
をそのデータの所属クラスタとする。
最初はクラスタが決まってないので適当に決めた代表が
クラスタ全体の重心であろうはずがない
そんな代表に近いからといって、その代表と同じクラスタに
データを所属させるのが正しいとは限らない
③ 各クラスタの重心によって代表点を更新する。
代表が変わったので再度クラスタ割当を見直さないといけない
④ クラスタ割当の変化がなくなるまで②と③を繰り返す。
例 D={2,4,6,10,12,14} k=2
代表の初期値 {7,15}
初期代表点の選択法
ランダム選択
実装は容易だが、良いクラスタが得られる可能性は低い
できるだけ離れた点を選択
1. 任意の点を定め、その点から最も遠い点を一つ目の代
表点とする。
2. すでに選ばれた代表点すべてからの平均距離の最も遠
い点を新しい代表点として選ぶ。この操作を代表点がK
個になるまで繰り返す。
良いクラスタが得られる可能性は高いが、計算量が k-
means 法自体の計算量よりも大きくなってしまう。
k-means 法の特徴
• クラスタ分割の結果は局所最適解であり、初期代表点(初期クラス
タ)に依存する。
• (超)球状のクラスタが得られやすい。
• 各クラスタは類似したサイズに分割される。
(上2つの特徴は代表点からの距離の総和を目的関数と
することからの当然の帰結といえる。)
https://gist.github.com/aquapathos/a16217
c180216777c01346f6298adbe9
低次元化
• 本質的な情報を保存したままデータの次元数を減らすこと
• 低次元化することで、データの背景にある法則性が浮かび上
がったり、解析しやすくなる。
例)画像や音声などのパターン情報は超高次元
1600万画素 = 4800万次元
囲碁の対局場面を1000万画素で動画撮影したデータは1秒分で
30フレーム×3色×1000万次元×8ビットのデータ量
⇒ 少なくとも 19×19×3ビットまで圧縮可能
(それでもなお、10360もの局面があり、10,000年後のCPUで宇宙の寿命
が尽きるまでかかっても全解探索できないであろう。)
• 次元圧縮という意味ではクラスタリングも低次元化の極端な
場合と言えなくはない。
低次元化技術の代表例
•主成分分析
(PCA:Principal Component analysis)
•自己組織化マップ
(SOM;Self-Organizing Map)
•深層学習
期末成績
中間成績
主成分
イヌ
ネコ
イカ
深層学習 Deep Learning
• 階層型ニューラルネットは一種の次元圧縮装置である
• 従来は3層程度までしか学習がうまくいかなかったが、
2000年台後半からプレトレーニング(事前学習)やドロップ
アウト(ユニットや結合を確率的に無効化する)など様々なブ
レークスルー技術が生まれ、多層でも学習が可能となった。

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

クラスタリング