Centroid

The representative point of a cluster is called a centroid. This is the center of the samples that belong to the cluster and works as a prototype of the cluster. Therefore, finding the appropriate centroids that partition samples in a good manner is the goal of the K-means algorithm:

The centroid can be calculated as the mean of every point that belongs to the cluster. Assuming the sample points in the dataset are N vectors expressed as , the centroid of the cluster, , can be represented as follows:

This is just an equally weighted ...

Get Hands-On Machine Learning with TensorFlow.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.