Centroid Plot Calculator

Explore cluster centers, assign points, compare distance metrics, animate centroid movement, inspect diagnostics, and export clear interactive results for machine learning analysis and discovery.

Calculated results

Interactive centroid plot

Zoom, pan, hover, reset, and export controls are available inside the chart.
For two-dimensional plots, select a cluster above and click the graph to reposition its centroid, then recalculate assignments.

Warnings and data notes

    1. Data input

    Paste structured data, upload a file, or load an example. The preview updates column selectors automatically.

    CSV, TSV, semicolon-separated, or pipe-separated data is supported.
    Data preview

    2. Column mapping and preprocessing

    3. Centroid and assignment settings

    Used by the one-assignment mode.
    Use one centroid per line. A cluster name may appear before its coordinates.

    4. Plot and diagnostic options

    5. Saved settings

    Formula used

    Arithmetic centroid: Ck = (1 / nk) Σxi
    Weighted centroid: Ck = Σ(wixi) / Σwi
    Inertia: Σ ||xi − Ccluster(i)||²

    A centroid represents the coordinate center of a cluster. The arithmetic centroid averages every selected feature. Weighted calculations give influential observations more importance.

    Nearest-centroid assignment compares each observation with every center. Iterative updates repeat assignment and recalculation until movement becomes small. The final arrangement describes compact cluster structure.

    How to use

    1. Paste data or upload a supported text file.
    2. Preview the data and confirm column mappings.
    3. Select preprocessing, distance, and centroid options.
    4. Choose plot labels, paths, boundaries, and diagnostics.
    5. Calculate the result and inspect every output table.
    6. Export the graph, assignments, summary, or report.

    Example data

    LabelXYClusterWeight
    P11.22.4A1
    P21.82.9A1
    P46.17.0B1
    P710.52.2C1

    Centroid plot interpretation

    Points near their centroid form compact, consistent clusters. Long connector lines reveal weak assignments or possible outliers. Widely separated centroids usually indicate stronger cluster distinction.

    Inertia becomes smaller when observations remain near assigned centers. Silhouette values near one indicate useful separation. Negative values can expose questionable cluster membership.

    Frequently asked questions

    What is a centroid?

    A centroid is the coordinate average representing a cluster center. It may use ordinary, weighted, or median calculations. Its position summarizes the included observations.

    How is a centroid different from a medoid?

    A centroid can be an artificial coordinate between observations. A medoid must be an actual dataset observation. Medoids can resist unusual values better.

    Which distance metric should I choose?

    Euclidean distance works well for many continuous features. Manhattan distance can reduce diagonal sensitivity. Cosine distance emphasizes vector direction instead.

    Why should features be scaled?

    Large numerical ranges can dominate distance calculations. Scaling gives selected features more comparable influence. Choose a method matching your interpretation.

    What does inertia measure?

    Inertia totals squared distances from points to centroids. Lower values indicate tighter assigned clusters. Comparisons require the same dataset and scaling.

    What is a good silhouette score?

    Higher positive values indicate better separation and compactness. Values near zero show overlapping cluster boundaries. Negative values suggest possible incorrect assignments.

    Can I calculate one dataset centroid?

    Set the cluster count to one for unlabeled data. Every valid observation receives one shared center. The output describes the complete dataset location.

    How are empty clusters handled?

    An empty iterative cluster receives a replacement observation. The calculator records a warning for review. Manual fixed centroids remain available without members.

    Can I export the results?

    Yes, summaries and assignments download as CSV files. Charts download as PNG or SVG images. A printable PDF report is also available.

    Related Calculators

    Cluster Scatter PlotElbow PlotSilhouette PlotDendrogramCluster HeatmapDistance Matrix HeatmapNearest-Neighbour Distance PlotCluster Size Bar ChartCluster Profile Radar Chart

    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.