Cluster Centroid Calculator in Machine Learning

Calculate, compare, and visualise cluster centroids with scaling, weighted observations, distance metrics, K-means iterations, quality measures, charts, and downloadable machine learning reports in seconds.

Dataset Input

Paste CSV data or upload a file. Column names are case-sensitive.

Column Configuration

Separate numeric column names with commas.
Use “all” to calculate every labelled cluster.

Centroid and Preprocessing Options

Distance and K-Means Options

Formula Used

The arithmetic centroid averages every coordinate independently. Weighted calculations multiply each coordinate by its observation weight. Scaling changes the calculation space before centroids are found.

Mean centroid: Cj = (1 / n) × Σxij
Weighted centroid: Cj = Σ(wi × xij) / Σwi
Within-cluster sum of squares: WCSS = Σ||xi − C||²

How to Use

  1. Paste a CSV dataset or upload a CSV file.
  2. Enter feature, cluster, identifier, and weight column names.
  3. Select centroid, scaling, missing-value, and distance options.
  4. Enable K-means when new cluster assignments are required.
  5. Submit the form and review centroids, metrics, tables, and charts.
  6. Copy, print, or download the calculated report.

Example Data

PointFeature XFeature YClusterWeight
A2411
B4611
C6812

For the unweighted mean, the centroid is (4, 6). Weighted results move closer to observations with larger weights. Feature scaling can change distances and K-means assignments.

Frequently Asked Questions

What is a cluster centroid?

A centroid is the coordinate-wise centre of a cluster. Mean centroids average every numeric feature. They may not match an actual observation.

How is a centroid different from a medoid?

A centroid is a calculated centre. A medoid is an actual observation. Medoids can be more robust to unusual points.

Why should features be scaled?

Large numeric ranges can dominate distance calculations. Scaling gives features more comparable influence. It often improves K-means behaviour.

When should weighted centroids be used?

Use weights when observations have unequal importance. Larger weights pull the centroid closer. Every weight must be non-negative.

What does WCSS measure?

WCSS measures squared Euclidean spread around centroids. Lower values indicate tighter clusters. Comparisons work best on identical datasets.

Can categorical features be included?

This calculator expects numeric feature columns. Encode categories numerically with care. Ordinary means may not represent category centres meaningfully.

How are missing values handled?

Rows can be removed or imputed. Mean and median options use available values. Zero replacement should match the dataset meaning.

What is K-means++?

K-means++ spreads initial centroids across the data. Better starting points can improve convergence. Results still depend on data geometry.

Why can outliers affect centroids?

Means respond strongly to extreme observations. Median or trimmed centroids reduce that influence. Outliers should still be investigated carefully.

Related Calculators

K-Means Clustering CalculatorEuclidean Distance CalculatorManhattan Distance CalculatorCosine Similarity CalculatorSilhouette Score CalculatorDavies-Bouldin Index CalculatorCalinski-Harabasz Score CalculatorWithin-Cluster Sum of Squares CalculatorElbow Method CalculatorDBSCAN Neighbourhood Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.