Skip to Content
Advanced Machine Learning with R
book

Advanced Machine Learning with R

by Cory Lesmeister, Dr. Sunil Kumar Chinnamgari
May 2019
Intermediate to advanced
664 pages
15h 41m
English
Packt Publishing
Content preview from Advanced Machine Learning with R

Working mechanics of the k-means algorithm

The execution of the k-means algorithm involves the following steps:

  1. Randomly select k observations from the dataset as the initial cluster centroids.
  2. For each observation in the dataset, perform the following:
    1. Compute the distance between the observation and each of the cluster centroids.
    2. Identify the cluster centroid that has minimum distance with the observation.
    3. Assign the observation to such closest centroid.
  1. With all points assigned to one of the cluster centroids, compute new cluster centroids. This can be done by taking the mean of all the points assigned to a cluster.
  2. Perform step 2 and step 3 repeatedly until the cluster centroids (mean) do not change or until a user-defined number ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning Using R

Machine Learning Using R

Karthik Ramasubramanian, Abhishek Singh
Machine Learning with R Cookbook - Second Edition

Machine Learning with R Cookbook - Second Edition

AshishSingh Bhatia, Yu-Wei, Chiu (David Chiu)
Practical Machine Learning in R

Practical Machine Learning in R

Fred Nwanganga, Mike Chapple

Publisher Resources

ISBN: 9781838641771Supplemental Content