SlideShare a Scribd company logo
Hadoop
Machine Learning
K-Means Algorithm
Elias Hasnat
K-Means for Social Application (Movie
Contents) Opportunities
K-means法のアルゴリズム
Step 1:K個のクラスターの中心をランダムに設定する。
Step 2:それぞれの個体を最も近い中心に割り当てる。
Step 3:クラスターごとに中心を計算しなおす。
 すべてのクラスター中心が変化しなければ終了。
    それ以外はStep 2へ戻る。
pseudo code for k-means
complexity O(k*n/p)
where k is number of clusters, n is number of data points and p is number of machines
kmeans(data) {
initial_centroids =pick(k, data)
upload(data)
writeToS3(initial_centroids)
old_centroids = initial_centroids
while (true){
map_reduce()
new_centroids = readFromS3() or readFromAzureBlob()
if change(new_centroids, old_centroids)< delta {
break
} else {
old_centroids = new_centroids
}
}
result = readFromS3() or readFromAzureBlob()
return result
}
SQL クエリでK-Means
SELECT @iteration+1, cluster_id,
AVERAGE(d.data) as center
FROM (SELECT d.data, cc.cluster_id,
ROW_NUMBER() OVER (PARTITION BY d.data
ORDER BY DISTANCE(d.data, cc.center) as ranking
FROM data d CROSS JOIN
(SELECT *
FROM cluster_centers cc
WHERE iteration = @iteration) cc
) a
WHERE ranking = 1
GROUP BY cluster_id
R でK−Means
url ranking
node = ranking[,1]
rank = ranking[,2]
group > length(rank)
[1] 281903
> length(node)
[1] 281903
> length(group)
[1] 281903
d
cl
K-means clustering with 3 clusters of sizes 20135, 20135, 20133
JavaでK-Means Mapper
protected void map(ClusterCenter key, Vector value, Context context)
throws IOException, InterruptedException {
ClusterCenter nearest = null;
double nearestDistance = Double.MAX_VALUE;
for (ClusterCenter c : centers) {
double dist = DistanceMeasurer.measureDistance(c, value);
if (nearest == null) {
nearest = c;
nearestDistance = dist;
} else {
if (nearestDistance > dist) {
nearest = c;
nearestDistance = dist;
}
}
}
context.write(nearest, value);
}
JavaでK-Means Reducer
protected void reduce(ClusterCenter key, Iterable<vector> values,</vector>
Context context) throws IOException, InterruptedException {
Vector newCenter = new Vector();
List<vector> vectorList = </vector>new LinkedList<vector>();</vector>
int vectorSize = key.getCenter().getVector().length;
newCenter.setVector(new double[vectorSize]);
for (Vector value : values) {
vectorList.add(new Vector(value));
for (int i = 0; i < value.getVector().length; i++) {
newCenter.getVector()[i] += value.getVector()[i];
}
}
for (int i = 0; i < newCenter.getVector().length; i++) {
newCenter.getVector()[i] = newCenter.getVector()[i]
/ vectorList.size();
}
ClusterCenter center = new ClusterCenter(newCenter);
centers.add(center);
for (Vector vector : vectorList) {
context.write(center, vector);
}
if (center.converged(key))
context.getCounter(Counter.CONVERGED).increment(1);
}

More Related Content

What's hot

Rough K Means - Numerical Example
Rough K Means - Numerical ExampleRough K Means - Numerical Example
Rough K Means - Numerical Example
Dr.E.N.Sathishkumar
 
Enhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetEnhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial Dataset
AlaaZ
 
K mean-clustering
K mean-clusteringK mean-clustering
K mean-clustering
Afzaal Subhani
 
K means clustering
K means clusteringK means clustering
K means clustering
Ahmedasbasb
 
K MEANS CLUSTERING
K MEANS CLUSTERINGK MEANS CLUSTERING
K MEANS CLUSTERING
singh7599
 
K-means clustering algorithm
K-means clustering algorithmK-means clustering algorithm
K-means clustering algorithm
Vinit Dantkale
 
K means
K meansK means
Data miningpresentation
Data miningpresentationData miningpresentation
Data miningpresentation
Manoj Krishna Yadavalli
 
K-means Clustering
K-means ClusteringK-means Clustering
K-means Clustering
Sajib Sen
 
Customer Segmentation using Clustering
Customer Segmentation using ClusteringCustomer Segmentation using Clustering
Customer Segmentation using Clustering
Dessy Amirudin
 
08 clustering
08 clustering08 clustering
K means clustering
K means clusteringK means clustering
K means clustering
Thomas K T
 
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
Edureka!
 
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
butest
 
Clustering part 1
Clustering part 1Clustering part 1
Clustering part 1
Abdul Kawsar Tushar
 
K means clustering | K Means ++
K means clustering | K Means ++K means clustering | K Means ++
K means clustering | K Means ++
sabbirantor
 
Clustering: A Survey
Clustering: A SurveyClustering: A Survey
Clustering: A Survey
Raffaele Capaldo
 
K means clustering algorithm
K means clustering algorithmK means clustering algorithm
K means clustering algorithm
Darshak Mehta
 
K means Clustering Algorithm
K means Clustering AlgorithmK means Clustering Algorithm
K means Clustering Algorithm
Kasun Ranga Wijeweera
 
Hierarchical clustering techniques
Hierarchical clustering techniquesHierarchical clustering techniques
Hierarchical clustering techniques
Md Syed Ahamad
 

What's hot (20)

Rough K Means - Numerical Example
Rough K Means - Numerical ExampleRough K Means - Numerical Example
Rough K Means - Numerical Example
 
Enhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial DatasetEnhance The K Means Algorithm On Spatial Dataset
Enhance The K Means Algorithm On Spatial Dataset
 
K mean-clustering
K mean-clusteringK mean-clustering
K mean-clustering
 
K means clustering
K means clusteringK means clustering
K means clustering
 
K MEANS CLUSTERING
K MEANS CLUSTERINGK MEANS CLUSTERING
K MEANS CLUSTERING
 
K-means clustering algorithm
K-means clustering algorithmK-means clustering algorithm
K-means clustering algorithm
 
K means
K meansK means
K means
 
Data miningpresentation
Data miningpresentationData miningpresentation
Data miningpresentation
 
K-means Clustering
K-means ClusteringK-means Clustering
K-means Clustering
 
Customer Segmentation using Clustering
Customer Segmentation using ClusteringCustomer Segmentation using Clustering
Customer Segmentation using Clustering
 
08 clustering
08 clustering08 clustering
08 clustering
 
K means clustering
K means clusteringK means clustering
K means clustering
 
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
K Means Clustering Algorithm | K Means Example in Python | Machine Learning A...
 
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
 
Clustering part 1
Clustering part 1Clustering part 1
Clustering part 1
 
K means clustering | K Means ++
K means clustering | K Means ++K means clustering | K Means ++
K means clustering | K Means ++
 
Clustering: A Survey
Clustering: A SurveyClustering: A Survey
Clustering: A Survey
 
K means clustering algorithm
K means clustering algorithmK means clustering algorithm
K means clustering algorithm
 
K means Clustering Algorithm
K means Clustering AlgorithmK means Clustering Algorithm
K means Clustering Algorithm
 
Hierarchical clustering techniques
Hierarchical clustering techniquesHierarchical clustering techniques
Hierarchical clustering techniques
 

Viewers also liked

Unity sdk-plugin
Unity sdk-pluginUnity sdk-plugin
Unity sdk-plugin
Elias Hasnat
 
Project PPT
Project PPTProject PPT
Project PPT
Dhaarna Singh
 
Density Based Clustering
Density Based ClusteringDensity Based Clustering
Density Based Clustering
SSA KPI
 
Chap8 basic cluster_analysis
Chap8 basic cluster_analysisChap8 basic cluster_analysis
Chap8 basic cluster_analysis
guru_prasadg
 
K-Means Algorithm
K-Means AlgorithmK-Means Algorithm
K-Means Algorithm
Carlos Castillo (ChaTo)
 
Clustering, k means algorithm
Clustering, k means algorithmClustering, k means algorithm
Clustering, k means algorithm
Junyoung Park
 
K-Means, its Variants and its Applications
K-Means, its Variants and its ApplicationsK-Means, its Variants and its Applications
K-Means, its Variants and its Applications
Varad Meru
 
K means Clustering
K means ClusteringK means Clustering
K means Clustering
Edureka!
 

Viewers also liked (8)

Unity sdk-plugin
Unity sdk-pluginUnity sdk-plugin
Unity sdk-plugin
 
Project PPT
Project PPTProject PPT
Project PPT
 
Density Based Clustering
Density Based ClusteringDensity Based Clustering
Density Based Clustering
 
Chap8 basic cluster_analysis
Chap8 basic cluster_analysisChap8 basic cluster_analysis
Chap8 basic cluster_analysis
 
K-Means Algorithm
K-Means AlgorithmK-Means Algorithm
K-Means Algorithm
 
Clustering, k means algorithm
Clustering, k means algorithmClustering, k means algorithm
Clustering, k means algorithm
 
K-Means, its Variants and its Applications
K-Means, its Variants and its ApplicationsK-Means, its Variants and its Applications
K-Means, its Variants and its Applications
 
K means Clustering
K means ClusteringK means Clustering
K means Clustering
 

Similar to K means

K Means Clustering in ML.pptx
K Means Clustering in ML.pptxK Means Clustering in ML.pptx
K Means Clustering in ML.pptx
Ramakrishna Reddy Bijjam
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes
 
An improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracyAn improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracy
ijpla
 
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptxANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
rinehi3578
 
Parallel Implementation of K Means Clustering on CUDA
Parallel Implementation of K Means Clustering on CUDAParallel Implementation of K Means Clustering on CUDA
Parallel Implementation of K Means Clustering on CUDA
prithan
 
8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm
Laura Petrosanu
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmOptimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering Algorithm
IJERA Editor
 
Chapter 11 cluster advanced, Han & Kamber
Chapter 11 cluster advanced, Han & KamberChapter 11 cluster advanced, Han & Kamber
Chapter 11 cluster advanced, Han & Kamber
Houw Liong The
 
Premeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means ClusteringPremeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means Clustering
IJCSIS Research Publications
 
Data analysis of weather forecasting
Data analysis of weather forecastingData analysis of weather forecasting
Data analysis of weather forecasting
Trupti Shingala, WAS, CPACC, CPWA, JAWS, CSM
 
Chapter 11 cluster advanced : web and text mining
Chapter 11 cluster advanced : web and text miningChapter 11 cluster advanced : web and text mining
Chapter 11 cluster advanced : web and text mining
Houw Liong The
 
"k-means-clustering" presentation @ Papers We Love Bucharest
"k-means-clustering" presentation @ Papers We Love Bucharest"k-means-clustering" presentation @ Papers We Love Bucharest
"k-means-clustering" presentation @ Papers We Love Bucharest
Adrian Florea
 
Lect4
Lect4Lect4
Lect4
sumit621
 
Chapter 11. Cluster Analysis Advanced Methods.ppt
Chapter 11. Cluster Analysis Advanced Methods.pptChapter 11. Cluster Analysis Advanced Methods.ppt
Chapter 11. Cluster Analysis Advanced Methods.ppt
Subrata Kumer Paul
 
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
Salah Amean
 
CMUデータベース輪読会第8回
CMUデータベース輪読会第8回CMUデータベース輪読会第8回
CMUデータベース輪読会第8回
Keisuke Suzuki
 
11 clusadvanced
11 clusadvanced11 clusadvanced
11 clusadvanced
JoonyoungJayGwak
 
11ClusAdvanced.ppt
11ClusAdvanced.ppt11ClusAdvanced.ppt
11ClusAdvanced.ppt
SueMiu
 
k-mean-clustering.ppt
k-mean-clustering.pptk-mean-clustering.ppt
k-mean-clustering.ppt
RanimeLoutar
 
k-mean-Clustering impact on AI using DSS
k-mean-Clustering impact on AI using DSSk-mean-Clustering impact on AI using DSS
k-mean-Clustering impact on AI using DSS
MarkNaguibElAbd
 

Similar to K means (20)

K Means Clustering in ML.pptx
K Means Clustering in ML.pptxK Means Clustering in ML.pptx
K Means Clustering in ML.pptx
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
An improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracyAn improvement in k mean clustering algorithm using better time and accuracy
An improvement in k mean clustering algorithm using better time and accuracy
 
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptxANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
 
Parallel Implementation of K Means Clustering on CUDA
Parallel Implementation of K Means Clustering on CUDAParallel Implementation of K Means Clustering on CUDA
Parallel Implementation of K Means Clustering on CUDA
 
8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm
 
Optimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering AlgorithmOptimising Data Using K-Means Clustering Algorithm
Optimising Data Using K-Means Clustering Algorithm
 
Chapter 11 cluster advanced, Han & Kamber
Chapter 11 cluster advanced, Han & KamberChapter 11 cluster advanced, Han & Kamber
Chapter 11 cluster advanced, Han & Kamber
 
Premeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means ClusteringPremeditated Initial Points for K-Means Clustering
Premeditated Initial Points for K-Means Clustering
 
Data analysis of weather forecasting
Data analysis of weather forecastingData analysis of weather forecasting
Data analysis of weather forecasting
 
Chapter 11 cluster advanced : web and text mining
Chapter 11 cluster advanced : web and text miningChapter 11 cluster advanced : web and text mining
Chapter 11 cluster advanced : web and text mining
 
"k-means-clustering" presentation @ Papers We Love Bucharest
"k-means-clustering" presentation @ Papers We Love Bucharest"k-means-clustering" presentation @ Papers We Love Bucharest
"k-means-clustering" presentation @ Papers We Love Bucharest
 
Lect4
Lect4Lect4
Lect4
 
Chapter 11. Cluster Analysis Advanced Methods.ppt
Chapter 11. Cluster Analysis Advanced Methods.pptChapter 11. Cluster Analysis Advanced Methods.ppt
Chapter 11. Cluster Analysis Advanced Methods.ppt
 
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
 
CMUデータベース輪読会第8回
CMUデータベース輪読会第8回CMUデータベース輪読会第8回
CMUデータベース輪読会第8回
 
11 clusadvanced
11 clusadvanced11 clusadvanced
11 clusadvanced
 
11ClusAdvanced.ppt
11ClusAdvanced.ppt11ClusAdvanced.ppt
11ClusAdvanced.ppt
 
k-mean-clustering.ppt
k-mean-clustering.pptk-mean-clustering.ppt
k-mean-clustering.ppt
 
k-mean-Clustering impact on AI using DSS
k-mean-Clustering impact on AI using DSSk-mean-Clustering impact on AI using DSS
k-mean-Clustering impact on AI using DSS
 

More from Elias Hasnat

BLE.pdf
BLE.pdfBLE.pdf
BLE.pdf
Elias Hasnat
 
FacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdfFacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdf
Elias Hasnat
 
Smart City IoT Solution Improved
Smart City IoT Solution ImprovedSmart City IoT Solution Improved
Smart City IoT Solution Improved
Elias Hasnat
 
Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)
Elias Hasnat
 
Lorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control pointLorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control point
Elias Hasnat
 
IoT Security with Azure
IoT Security with AzureIoT Security with Azure
IoT Security with Azure
Elias Hasnat
 
産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューション産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューション
Elias Hasnat
 
Soap vs REST-API
Soap vs REST-APISoap vs REST-API
Soap vs REST-API
Elias Hasnat
 
AIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタックAIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタック
Elias Hasnat
 
IoT security reference architecture
IoT security  reference architectureIoT security  reference architecture
IoT security reference architecture
Elias Hasnat
 
Intelligent video stream detection platform
Intelligent video stream detection platformIntelligent video stream detection platform
Intelligent video stream detection platform
Elias Hasnat
 
Machine Learning Algorithms
Machine Learning AlgorithmsMachine Learning Algorithms
Machine Learning Algorithms
Elias Hasnat
 
REST API
REST APIREST API
REST API
Elias Hasnat
 
Mqtt
MqttMqtt
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
Elias Hasnat
 
Java8 features
Java8 featuresJava8 features
Java8 features
Elias Hasnat
 
Dalvikよりart
DalvikよりartDalvikよりart
Dalvikよりart
Elias Hasnat
 
Cocos2dx
Cocos2dxCocos2dx
Cocos2dx
Elias Hasnat
 
China Mobile Market
China Mobile MarketChina Mobile Market
China Mobile Market
Elias Hasnat
 

More from Elias Hasnat (19)

BLE.pdf
BLE.pdfBLE.pdf
BLE.pdf
 
FacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdfFacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdf
 
Smart City IoT Solution Improved
Smart City IoT Solution ImprovedSmart City IoT Solution Improved
Smart City IoT Solution Improved
 
Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)
 
Lorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control pointLorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control point
 
IoT Security with Azure
IoT Security with AzureIoT Security with Azure
IoT Security with Azure
 
産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューション産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューション
 
Soap vs REST-API
Soap vs REST-APISoap vs REST-API
Soap vs REST-API
 
AIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタックAIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタック
 
IoT security reference architecture
IoT security  reference architectureIoT security  reference architecture
IoT security reference architecture
 
Intelligent video stream detection platform
Intelligent video stream detection platformIntelligent video stream detection platform
Intelligent video stream detection platform
 
Machine Learning Algorithms
Machine Learning AlgorithmsMachine Learning Algorithms
Machine Learning Algorithms
 
REST API
REST APIREST API
REST API
 
Mqtt
MqttMqtt
Mqtt
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
 
Java8 features
Java8 featuresJava8 features
Java8 features
 
Dalvikよりart
DalvikよりartDalvikよりart
Dalvikよりart
 
Cocos2dx
Cocos2dxCocos2dx
Cocos2dx
 
China Mobile Market
China Mobile MarketChina Mobile Market
China Mobile Market
 

Recently uploaded

Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 

Recently uploaded (20)

Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 

K means

  • 2. K-Means for Social Application (Movie Contents) Opportunities
  • 3. K-means法のアルゴリズム Step 1:K個のクラスターの中心をランダムに設定する。 Step 2:それぞれの個体を最も近い中心に割り当てる。 Step 3:クラスターごとに中心を計算しなおす。  すべてのクラスター中心が変化しなければ終了。     それ以外はStep 2へ戻る。
  • 4. pseudo code for k-means complexity O(k*n/p) where k is number of clusters, n is number of data points and p is number of machines kmeans(data) { initial_centroids =pick(k, data) upload(data) writeToS3(initial_centroids) old_centroids = initial_centroids while (true){ map_reduce() new_centroids = readFromS3() or readFromAzureBlob() if change(new_centroids, old_centroids)< delta { break } else { old_centroids = new_centroids } } result = readFromS3() or readFromAzureBlob() return result }
  • 5. SQL クエリでK-Means SELECT @iteration+1, cluster_id, AVERAGE(d.data) as center FROM (SELECT d.data, cc.cluster_id, ROW_NUMBER() OVER (PARTITION BY d.data ORDER BY DISTANCE(d.data, cc.center) as ranking FROM data d CROSS JOIN (SELECT * FROM cluster_centers cc WHERE iteration = @iteration) cc ) a WHERE ranking = 1 GROUP BY cluster_id
  • 6. R でK−Means url ranking node = ranking[,1] rank = ranking[,2] group > length(rank) [1] 281903 > length(node) [1] 281903 > length(group) [1] 281903 d cl K-means clustering with 3 clusters of sizes 20135, 20135, 20133
  • 7. JavaでK-Means Mapper protected void map(ClusterCenter key, Vector value, Context context) throws IOException, InterruptedException { ClusterCenter nearest = null; double nearestDistance = Double.MAX_VALUE; for (ClusterCenter c : centers) { double dist = DistanceMeasurer.measureDistance(c, value); if (nearest == null) { nearest = c; nearestDistance = dist; } else { if (nearestDistance > dist) { nearest = c; nearestDistance = dist; } } } context.write(nearest, value); }
  • 8. JavaでK-Means Reducer protected void reduce(ClusterCenter key, Iterable<vector> values,</vector> Context context) throws IOException, InterruptedException { Vector newCenter = new Vector(); List<vector> vectorList = </vector>new LinkedList<vector>();</vector> int vectorSize = key.getCenter().getVector().length; newCenter.setVector(new double[vectorSize]); for (Vector value : values) { vectorList.add(new Vector(value)); for (int i = 0; i < value.getVector().length; i++) { newCenter.getVector()[i] += value.getVector()[i]; } } for (int i = 0; i < newCenter.getVector().length; i++) { newCenter.getVector()[i] = newCenter.getVector()[i] / vectorList.size(); } ClusterCenter center = new ClusterCenter(newCenter); centers.add(center); for (Vector vector : vectorList) { context.write(center, vector); } if (center.converged(key)) context.getCounter(Counter.CONVERGED).increment(1); }