Cluster Centroids is a prototype-based under-sampling technique that uses K-means clustering to group the majority class into k clusters and then replaces each cluster with its geometric center, or centroid. This method retains the underlying structure of the majority class while drastically reducing its size to match the minority class count, preventing the model from being overwhelmed by non-fraudulent transactions.
Glossary
Cluster Centroids

What is Cluster Centroids?
Cluster Centroids is an under-sampling method that replaces clusters of majority class samples with their representative centroid, using K-means clustering to generate a reduced set of majority class data points.
Unlike random under-sampling, which can discard critical information near the decision boundary, Cluster Centroids preserves the data distribution by representing dense regions with a single synthetic point. The number of clusters k is typically set to the number of minority class samples, creating a perfectly balanced dataset. However, the generated centroids are artificial points that may not represent actual, observable transaction features, which can be a limitation for highly interpretable models.
Key Features of Cluster Centroids
Cluster Centroids is a prototype-based under-sampling method that uses K-means clustering to replace the majority class with a compact set of representative centroids, preserving data topology while balancing class distribution.
K-Means Prototype Generation
The algorithm applies K-means clustering to the majority class, setting K equal to the number of minority class samples. Each cluster is then replaced by its centroid—the arithmetic mean of all points in that cluster. This transforms the majority class from raw, potentially redundant instances into a set of synthetic prototypes that capture the underlying data distribution. Unlike random under-sampling, which discards information, this method retains the topological structure of the majority class by preserving its natural groupings.
Distance Metric Sensitivity
The quality of the generated centroids depends heavily on the chosen distance metric. Euclidean distance is the default but may perform poorly on high-dimensional or categorical financial data. Alternatives include:
- Manhattan distance for grid-like feature spaces
- Cosine similarity for directional transaction vectors
- Mahalanobis distance when features are correlated Poor metric selection can produce centroids that misrepresent the true cluster structure, degrading downstream classifier performance.
Handling High-Dimensional Transaction Data
In fraud detection, transaction features often span hundreds of dimensions. K-means suffers from the curse of dimensionality, where distance measures become less meaningful. To mitigate this:
- Apply PCA or t-SNE for dimensionality reduction before clustering
- Use feature selection to retain only high-information attributes
- Consider bisecting K-means for more stable cluster assignments Without preprocessing, centroids may converge to poor local optima, failing to represent the majority class distribution accurately.
Computational Complexity and Scalability
The standard K-means implementation has a time complexity of O(n * K * d * i), where n is the number of majority samples, K is the number of clusters, d is dimensionality, and i is iterations. For large-scale payment networks with millions of legitimate transactions, this becomes computationally expensive. Optimizations include:
- Mini-batch K-means for stochastic gradient descent updates
- K-means++ initialization for faster convergence
- Parallelized implementations on distributed computing frameworks These techniques make Cluster Centroids viable for production fraud pipelines.
Impact on Decision Boundaries
By replacing dense clusters of majority samples with single centroids, the method effectively shrinks the majority class region in feature space. This can:
- Clarify the decision boundary by removing overlapping majority instances
- Increase minority class recall as the classifier is less overwhelmed
- Risk information loss if clusters are heterogeneous or contain critical boundary examples Pairing Cluster Centroids with Tomek Links cleaning can further refine the boundary by removing centroids that sit too close to minority class instances.
Integration with Ensemble Methods
Cluster Centroids can be embedded within ensemble frameworks to recover information lost during under-sampling. EasyEnsemble and BalanceCascade are two architectures that train multiple classifiers on different centroid-based under-sampled subsets. Each iteration can use a different random seed for K-means initialization, producing diverse views of the majority class. The ensemble aggregates predictions, often outperforming a single centroid-based model while maintaining the computational benefits of reduced training data.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear, technical answers to the most common questions about using Cluster Centroids for under-sampling imbalanced financial fraud datasets.
Cluster Centroids is a prototype-based under-sampling technique that replaces groups of majority class samples with their representative centroid, using K-means clustering to generate a reduced, representative set of majority class data points. The algorithm first partitions the majority class into k clusters, where k is typically set to the number of minority class samples. It then computes the geometric center (centroid) of each cluster by averaging the feature values of all members. These centroids become the new synthetic majority class representatives, replacing the original dense clusters. This approach preserves the underlying data distribution and central tendencies of the majority class while drastically reducing its volume, unlike random under-sampling which may discard critical boundary information. The method is particularly effective in financial fraud anomaly detection where legitimate transaction patterns form natural clusters that can be summarized without losing their defining characteristics.
Related Terms
Explore complementary strategies for handling class imbalance, from other centroid-based and prototype methods to hybrid resampling approaches that combine under-sampling with data cleaning.
One-Sided Selection
A combined under-sampling strategy that first removes redundant majority class examples using Tomek Links, then applies Condensed Nearest Neighbors to eliminate instances far from the decision boundary.
- Step 1: Identify and remove majority samples that form Tomek Links with minority samples, cleaning class overlap.
- Step 2: Apply CNN to retain only those majority samples necessary for correct classification.
This method contrasts with Cluster Centroids by focusing on boundary preservation rather than global data reduction through clustering.
Neighborhood Cleaning Rule
An under-sampling algorithm that uses Edited Nearest Neighbors to remove majority class examples and then removes minority class examples that are misclassified by three nearest neighbors.
- Focus: Cleans both classes, not just the majority.
- Mechanism: If a minority sample is misclassified by its three nearest neighbors, it is considered noise and removed.
This dual-cleaning approach differs from Cluster Centroids, which only reduces the majority class and assumes minority samples are valid.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us