Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Constrained K-means Clustering (クラスタサイズの制限をしたK-...
Search
NearMeの技術発表資料です
PRO
July 12, 2024
Programming
500
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Constrained K-means Clustering (クラスタサイズの制限をしたK-means法) を調べてみた
NearMeの技術発表資料です
PRO
July 12, 2024
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
Claude Code × git worktree で並列開発 (続き) -差分のサービスだけを併設する-
nearme_tech
PRO
1
61
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
75
LLM + 強化学習
nearme_tech
PRO
0
34
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
98
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
67
初めてのLean言語
nearme_tech
PRO
0
110
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
42
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
82
SQL/ID抽出タスクから考える 実践的なハルシネーション対策
nearme_tech
PRO
1
93
Other Decks in Programming
See All in Programming
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
App Intentsのビルドプロセスを支える技術
kntkymt
0
490
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
3.1k
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1k
Verilogで学ぶCPU自作入門.pdf
uyuki234
7
3.9k
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
380
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.7k
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
580
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.6k
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
Featured
See All Featured
Between Models and Reality
mayunak
4
480
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
Test your architecture with Archunit
thirion
2
2.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.9k
Thoughts on Productivity
jonyablonski
76
5.4k
エンジニアに許された特別な時間の終わり
watany
109
250k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
590
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Transcript
0 Constrained K-means Clustering (クラスタサイズの制限をしたK-means法) を調べてみた 2024-07-12 第98回NearMe技術勉強会 Mio Takakuwa
1 背景 クラスタサイズ(1クラスターの内部の数)に 制限を加えたクラスタリングを行いたかった ⇨ “Constrained K-means Clustering” というものを見つけたので使ってみた&中身を調べてみた ※“Constrained
K-means Clustering”と検索するとたくさん出てくるが、 今回はクラスタサイズの制限ができるものを扱った 論文: https://www.researchgate.net/publication/2458036_Constrained_K-Means_Clustering (※この論文は要素がないクラスタを作らない工夫として、最小値の制限をしているが、 最大も同じように制限することでクラスタサイズの制限を行う)
2 K-means Clustering クラスタの平均的な位置を求めて、データをk個のクラスタに分類する手法 【アルゴリズム】 1. クラスタの中心を選ぶ 2. データをそれぞれ最も近い クラスタに割り当てる
3. クラスタ中心を更新する クラスタの中心が動かなくなるまで 繰り返す
3 K-means Clustering
4 K-means Clustering それぞれに 対応
5 K-means Clustering クラスタサイズが0のクラスタが できてしまう 【K-means Clusteringの問題点】
6 Constrained K-means Clustering (最小値のみの制約) それぞれに 対応
7 Constrained K-means Clustering (最小値のみの制約) この式を解きたい! ⇨最小費用フロー問題として解く
8 最小費用フロー問題 (Minimum Cost Flow Problem) A B D C
全体のコストを最小化しつつ、ノード Aからノード Dに10個届けたい 容量:5 コスト: 2 容量:8 コスト: 4 容量:5 コスト: 1 容量:10 コスト: 3 供給:10 需要:10 しかし、 A⇨Bは5個送れるが、コストは2かかる A⇨Cは8個送れるが、コストは4かかる…
9 Constrained K-means Clustering ・・・ データ クラスタ中心 ・・・ 1 1
1 1 (最小値のみの制約) 供給(−需要) 容量 コスト
10 Constrained K-means Clustering ・・・ データ クラスタ中心 ・・・ 1 1
1 1 人工需要 ノード データの 供給 クラスタ中心の 需要 (最小値のみの制約)
11 Constrained K-means Clustering ・・・ データ クラスタ中心 ・・・ 1 1
1 1 人工需要 ノード データの 供給 クラスタ中心の 需要 (最小値のみの制約) 供給(−需要) 容量 コスト
12 Constrained K-means Clustering ・・・ データ クラスタ中心 ・・・ 1 1
1 1 人工需要 ノード データの 供給 クラスタ中心の 需要 (最小値・最大値の制約) 供給(−需要) 容量 コスト
13 Constrained K-means Clustering https://colab.research.google.com/drive/1ytuPK2cS5I8RIv a5HQ7b9JzCYieNyEhF?usp=drive_link 【アルゴリズム】 1. クラスタの中心を選ぶ 2.
データをそれぞれ最も近い クラスタに割り当てる 3. クラスタ中心を更新 最小費用フロー問題に落としたい ⇨ノード、エッジ、コスト、供給量、容量の定義が必要
14 参考文献 P. S. Bradley K. P. Bennett A. Demiriz Microsoft
Research https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-20 00-65.pdf https://qiita.com/kuga-qiita/items/5588d5469f3268b7fd39 https://fmarthoz.medium.com/k-means-algorithm-in-4-parts-6f44dc21d119 https://github.com/joshlk/k-means-constrained
15 Thank you