Reader small image

You're reading from  Learning Predictive Analytics with R

Product typeBook
Published inSep 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781782169352
Edition1st Edition
Languages
Right arrow
Author (1)
Eric Mayor
Eric Mayor
author image
Eric Mayor

Eric Mayor is a senior researcher and lecturer at the University of Neuchatel, Switzerland. He is an enthusiastic user of open source and proprietary predictive analytics software packages, such as R, Rapidminer, and Weka. He analyzes data on a daily basis and is keen to share his knowledge in a simple way.
Read more about Eric Mayor

Right arrow

Learning by doing – partition clustering with kmeans()


Perhaps the most widely used clustering family of algorithms is k-means. In this section, we will examine how it works and ways to assess the quality of a clustering solution.

K-means is a partitioning algorithm that produces k (user-defined number) clusters of cases that are more similar to each other than to cases outside the cluster. K-means starts by randomly initiating the centroid (the value of the considered dimensions) of each cluster. From now, the process, aiming at creating homogenous clusters, is iterative until a final solution is found. For each case, the distance from the centroid of each cluster is computed, and cases are assigned to the closest cluster. After this step, k-means computes the new values of the centroid of each cluster, as the means of all the cases belonging to the cluster. The process stops when the distance between the cases and the centroid is not decreasing anymore. It is noteworthy that the final result...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Predictive Analytics with R
Published in: Sep 2015Publisher: PacktISBN-13: 9781782169352

Author (1)

author image
Eric Mayor

Eric Mayor is a senior researcher and lecturer at the University of Neuchatel, Switzerland. He is an enthusiastic user of open source and proprietary predictive analytics software packages, such as R, Rapidminer, and Weka. He analyzes data on a daily basis and is keen to share his knowledge in a simple way.
Read more about Eric Mayor