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
- Paste a CSV dataset or upload a CSV file.
- Enter feature, cluster, identifier, and weight column names.
- Select centroid, scaling, missing-value, and distance options.
- Enable K-means when new cluster assignments are required.
- Submit the form and review centroids, metrics, tables, and charts.
- Copy, print, or download the calculated report.
Example Data
| Point | Feature X | Feature Y | Cluster | Weight |
|---|---|---|---|---|
| A | 2 | 4 | 1 | 1 |
| B | 4 | 6 | 1 | 1 |
| C | 6 | 8 | 1 | 2 |
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.