liveBook · Manning

Centroid

A centroid is a central point representing a geometric figure or set of points, commonly calculated as the coordinate-wise mean, with weights when applicable.

How 7 Manning books explain it

Advanced Algorithms and Data Structures

A center of mass is the point representing the coordinate-weighted average location of a body or collection of points.

How it is used
Locates spherical SS-tree envelopes and represents clusters for nearest-centroid assignment in k-means.
How deep it goes
Defines the center of mass and implements coordinate-wise means, node-envelope updates, and iterative recentering; defers smallest-enclosing-sphere approximation details.
Examples
Illustrates nearest-centroid insertion, a three-centroid k-means iteration, and contrasting centroid-centered and minimum covering spheres.
What you can do after
Build it from scratch to update SS-tree envelopes or recenter k-means clusters, while recognizing overlap and outlier trade-offs.

Read how Advanced Algorithms and Data Structures explains centroid →

D3.js in Action, Third Edition

A centroid is the geometric center of a shape or region.

How it is used
Positions labels at the visual center of arcs in pie and donut charts.
How deep it goes
Explains centroid calculation, returned coordinates, and SVG alignment, but defers general shape-centroid mathematics.
Examples
Demonstrates a 35% precipitation label and percentage labels placed on multiple donut-chart arcs.
What you can do after
Apply it via D3’s arc generator to calculate and align labels inside pie or donut-chart arcs.

Read how D3.js in Action, Third Edition explains centroid →

Data Without Labels

A centroid is the arithmetic mean position of a set of points and represents a cluster in centroid-based clustering.

How it is used
Represents clusters so centroid-based clustering can compare points with groups by distance.
How deep it goes
Works through iterative assignment and mean-based center updates, then retrieves fitted centers; defers further centroid mathematics to an appendix.
Examples
Uses an illustrated three-center iteration and a standardized vehicle dataset clustered and profiled with Python.
What you can do after
Apply it via scikit-learn to retrieve cluster centers and use them to profile a fitted vehicle-clustering result.

Read how Data Without Labels explains centroid →

Outlier Detection in Python

A cluster center is a representative location or point associated with a cluster and used to measure observations' proximity to that cluster.

How it is used
Uses cluster centers as reference locations for judging how unusual observations are within clustered data.
How deep it goes
Explains center-relative and cluster-relative distance scoring, including an optional size adjustment, without deriving how centers are estimated.
Examples
Illustrates scoring with single- and multiple-cluster results and contrasts it with DBSCAN flags for unassigned points.
What you can do after
Apply it via Gaussian mixture clustering and Mahalanobis distance to compare points with their own cluster’s typical distance.

Read how Outlier Detection in Python explains centroid →

Statistics Slam Dunk

A centroid is the central position of a set of points, commonly calculated as the coordinate-wise mean.

How it is used
Uses centroids to assign data points to nearby clusters and recalculate cluster centers during K-means.
How deep it goes
Explains centroids through iterative assignment, mean recalculation, convergence, and within-cluster variation.
Examples
Uses NBA team payrolls and regular-season wins to calculate four cluster centroids and assign every team.
What you can do after
Apply it via base R's kmeans() and interpret cluster means as centroids.

Read how Statistics Slam Dunk explains centroid →

Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

A centroid is a representative center of a cluster, typically computed as the mean position of its member points.

How it is used
Uses centroids to partition normalized data points into a user-selected number of clusters.
How deep it goes
Explains centroid assignment, coordinate-wise mean updates, convergence, initialization, and practical limitations.
Examples
Demonstrates centroids with Swift Point3D data and governor longitude-age clusters.
What you can do after
Build it from scratch with a Swift KMeans type that initializes, updates, and tests centroid convergence.

Read how Classic Computer Science Problems in Swift: Essential techniques for practicing programmers explains centroid →

Cyber Threat Hunting

A centroid is the arithmetic mean of the data points assigned to a cluster and represents that cluster's center.

How it is used
Uses centroids to assign data points to clusters and identify potentially interesting smaller groups in traffic data.
How deep it goes
Explains centroid calculation, distance assignment, iteration, scaling, and outlier sensitivity without deriving the algorithm’s implementation.
Examples
Uses a 14-feature traffic table, four clusters, two-dimensional plots, histograms, and cluster-size counts.
What you can do after
Apply it via scikit-learn to fit k-means, label rows, visualize clusters, and compare cluster sizes.

Read how Cyber Threat Hunting explains centroid →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.