Clustering
Clustering is the technique of grouping data items according to similarity or shared characteristics.
Data Without Labels
Clustering is an unsupervised technique that groups data points so that members of the same group are more similar to one another than to members of other groups.
- How it is used
- Groups unlabeled observations to discover patterns and create actionable customer or market segments.
- How deep it goes
- Works through method choices, distance measures, evaluation metrics, data preparation, and Python applications, with some mathematical details deferred to an appendix.
- Examples
- Uses retail customer segmentation and a Python TF-IDF example that groups football and travel sentences.
- What you can do after
- Apply it via Python clustering workflows, then assess whether the resulting groups are distinct and useful for a business decision.
The Well-Grounded Data Analyst
Clustering is the process of grouping observations so that members of the same group are more similar to one another than to members of other groups.
- How it is used
- Deploys clustering to create customer or product segments that support different recommendations, offers, or actions.
- How deep it goes
- Explains exploratory checks, scaling, algorithm selection, assignment, cluster-count comparison, and persona-based evaluation.
- Examples
- Uses mobile browsing behavior, scaled user features, inertia comparisons, cluster assignments, centers, and named user personas.
- What you can do after
- Apply it via Python, pandas, matplotlib, and scikit-learn to produce and interpret actionable user segments.
Read how The Well-Grounded Data Analyst explains clustering →
Outlier Detection in Python
An unsupervised learning technique that divides items into groups whose members are more similar to one another than to members of other groups.
- How it is used
- Uses groups of similar unlabeled items as comparison sets for finding unusual records.
- How deep it goes
- Develops global and local outlier interpretations, limitations, and several scoring workflows rather than a single universal procedure.
- Examples
- Uses animal images, financial transactions, wall-robot-navigation measurements, and 20 Newsgroups messages.
- What you can do after
- Apply it via scikit-learn DBSCAN to flag unassigned records and inspect their position against clusters.
Advanced Algorithms and Data Structures
A clustering algorithm groups unlabeled data points into subsets according to relationships or similarities among them.
- How it is used
- Groups unlabeled data for customer segmentation, outlier detection, and preprocessing.
- How deep it goes
- Works through k-means initialization, assignment, and recentering, and contrasts density-based methods and evaluation choices.
- Examples
- Uses 2-D point diagrams and income-versus-spending customer groups compared at five, six, and seven centroids.
- What you can do after
- Build it from scratch with k-means pseudocode and evaluate parameter choices using the elbow method.
Read how Advanced Algorithms and Data Structures explains clustering →
Grokking Machine Learning
An algorithm that partitions data points into groups based on similarity.
- How it is used
- Groups unlabeled data into similar clusters to extract information or make the data easier to handle.
- How deep it goes
- Defines clustering and illustrates feature-based groupings, without detailing a clustering algorithm or evaluation method.
- Examples
- Illustrates grouping houses by features, emails by size and recipients, and images by animal similarity.
- What you can do after
- Apply clustering to group unlabeled houses, emails, or images by selected similarities.
The Art of AI Product Development
Clustering is an unsupervised learning technique that groups data points according to similarities in their characteristics.
- How it is used
- Structures poorly understood user data into behavioral segments for personalization, marketing, and feature decisions.
- How deep it goes
- Works through feature choice, three algorithm options, evaluation metrics, iteration, and acting on segments without code or mathematical derivations.
- Examples
- Uses e-commerce recommendation and purchase behaviors, four interpreted user segments, and a scraping bot discovered as an anomaly.
- What you can do after
- Evaluate/understand candidate clusters and use validated segments to guide product actions or define classes for new users.
Read how The Art of AI Product Development explains clustering →
Statistics Slam Dunk
Customer segmentation is the division of customers into groups based on shared purchasing, demographic, or other attributes.
- How it is used
- Segments customers, teams, or other objects into similarity-based groups for analysis and tailored strategies.
- How deep it goes
- Explains K-means iteration, centroid assignment, convergence, distance, and cluster-count selection, alongside hierarchical clustering.
- Examples
- Uses customer demographics and purchases, NBA payrolls and wins, and draft-pick career win shares.
- What you can do after
- Apply it via R to segment observations, compare cluster counts, and visualize hierarchical or K-means results.
The AI Pocket Book
An unsupervised learning method that groups similar data points into clusters.
- How it is used
- Uses unlabeled data to explore patterns and group similar points.
- How deep it goes
- Defines grouping and illustrates ambiguity, but does not explain clustering algorithms or internal mechanics.
- Examples
- Uses patient medical records, alternative cluster counts, and the knee or elbow curve heuristic.
- What you can do after
- Apply clustering to explore data while judging its groupings as non-unique and difficult to validate.
First-Party Data Activation
The practice of dividing a customer or user population into groups with shared characteristics or behaviors for differentiated marketing.
- How it is used
- Groups customers and leads for targeted paid media, CRM nurturing, and personalized outreach.
- How deep it goes
- Explains segmentation through activation choices and performance measures, but defers technical how-to steps.
- Examples
- Illustrates ticket-buyer segments, propensity scores, and a triggered sales notification for a season-ticket upsell.
- What you can do after
- Apply it via GrowthLoop to activate audience segments across channels, then evaluate conversion and acquisition metrics.
Optimization Algorithms: AI techniques for design, planning, and control problems
The task of partitioning objects into groups whose members are more similar to one another than to members of other groups.
- How it is used
- Frames clustering as a combinatorial problem for grouping objects by similarity or dissimilarity.
- How deep it goes
- Defines unordered grouping and relates partition counts to Stirling numbers, without detailing a clustering algorithm.
- Examples
- Uses smart shopping or luggage carts gathering near designated assembly points as a practical example.
- What you can do after
- Understand clustering as grouping objects into unordered sets according to similarity or dissimilarity.
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
Clustering is a computational technique that divides data points into groups whose members are related according to some measure or interpretation.
- How it is used
- Uses data grouping to reveal structure when dataset parts are unknown.
- How deep it goes
- Defines clustering and details k-means assignment, centroid updates, normalization, initialization, and stopping; leaves choosing k to experimentation.
- Examples
- Uses grocery-shopping patterns, governor age and longitude, and applications in patrol, biology, image recognition, and voter targeting.
- What you can do after
- Apply k-means in Swift to group data points, then inspect whether the resulting clusters are meaningful.
AI-Powered Search
Clustering is an unsupervised learning technique that groups items according to similarity.
- How it is used
- Uses embedding-based categories to constrain personalization and keep results related to the current query.
- How deep it goes
- Explains an embedding-to-label workflow, inspection with top words and PCA, and query assignment, but not clustering theory or optimization internals.
- Examples
- Uses product catalogs, top cluster words, PCA plots, microwave queries, and related kitchen-product clusters.
- What you can do after
- Build it from scratch with Python by clustering embeddings, labeling items, inspecting groups, and mapping queries to categories.
How Large Language Models Work
A technique that groups data items according to similarities among their features or representations.
- How it is used
- Groups embedding representations to organize similar texts, route cases, and expose patterns for practical decisions.
- How deep it goes
- Explains embeddings, grouping, named algorithms, and a support workflow, but does not provide algorithmic mechanics or parameter guidance.
- Examples
- Uses market-segment analysis, plotted embedding texts, and grouped customer problems as concrete examples.
- What you can do after
- Apply clustering to embedding-based workflows that organize similar cases and route them toward analysts or vetted solutions.
Read how How Large Language Models Work explains clustering →
Data Analysis with LLMs
Text clustering is the unsupervised grouping of text documents according to the similarity of their represented features.
- How it is used
- Groups semantically similar documents when categories are not known in advance, such as emails about changing workplace topics.
- How deep it goes
- Explains semantic embeddings and an end-to-end CSV workflow, while noting that choosing the right number of clusters can be difficult.
- Examples
- Separates poems from emails in a mixed dataset using two clusters and outputs a cluster ID for each row.
- What you can do after
- Build it from scratch by embedding CSV text with OpenAI and clustering vectors with scikit-learn K-means.
Inside AI
Clustering is the computational task of grouping data items according to similarities without requiring predefined categories.
- How it is used
- Uses similarity-based grouping to discover structure in unlabeled data and support segmentation, recommendations, inventory planning, and pattern detection.
- How deep it goes
- Defines grouping and illustrates applications, but does not explain specific algorithms, implementation steps, or evaluation methods.
- Examples
- Uses retail customer groups, population-based city groups, and financial-transaction analysis as concrete applications.
- What you can do after
- Apply clustering to segment customers, group cities, and explore patterns in unlabeled or unorganized data.
Data-Driven Cybersecurity
Clustering is a data-analysis technique that groups observations according to similarity without requiring predefined labels.
- How it is used
- Uses similarity-based grouping to analyze cybersecurity data and surface behavior that may warrant investigation.
- How deep it goes
- Works through K-Means device grouping and visualization, and also identifies DBSCAN as an approach for spotting outliers.
- Examples
- Uses device login features for K-Means and network communication patterns for DBSCAN threat detection.
- What you can do after
- Diagnose potentially anomalous device behavior by inspecting cluster assignments and outliers.
Learn Docker in a Month of Lunches, Second Edition
A cluster is a group of machines managed together as a single computing system.
- How it is used
- Groups machines under Kubernetes so applications can be managed against the cluster as a whole.
- How deep it goes
- Defines cluster membership and whole-cluster operation, while leaving provisioning mostly to a platform.
- Examples
- Names Azure AKS provisioning, Docker Desktop, and Docker or containerd runtimes.
- What you can do after
- Operate a cluster by provisioning it through a platform and using kubectl to work with it as a whole.
Read how Learn Docker in a Month of Lunches, Second Edition explains clustering →
Financial AI in Practice
Clustering is the grouping of observations according to similarities in their measured attributes.
- How it is used
- Uses clustering to group similar numerical profiles when forming bins for credit scoring.
- How deep it goes
- Describes clustering as a grouping option but does not detail its algorithm or implementation.
- Examples
- Names K-means as an example for grouping observations with similar numerical profiles.
- What you can do after
- Evaluate clustering as an option for grouping numerical profiles when creating credit-scoring bins.
Related concepts
- K-means clusteringproduced by · K-means clustering partitions data into a specified number of groups by assigning observations to representative centers and iteratively updating those centers to reduce within-group distances.
- k-means++ initializationincludes · K-means++ initialization is a procedure that selects initial centroids using probability proportional to squared distance from previously selected centroids.
- unsupervised learningkind of · Unsupervised learning is a machine-learning approach that discovers patterns, structure, or representations in data without labeled target outputs.
- DBSCANincludes · DBSCAN is a density-based clustering algorithm that groups observations in dense regions and identifies observations in lower-density regions as noise or outliers.
- hierarchical clusteringincludes · Hierarchical clustering is a clustering method that organizes observations into nested groups by successively merging or splitting clusters.
- embeddingused by · A numerical vector representation of an item or input that encodes features or relationships useful for computational tasks.
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.

















