Tunny Icon
TunnyDocs

The next-gen Grasshopper optimization tool.

Clustering

An overview of the methods used in Tunny Dashboard's Cluster Scatter 2D / 3D widgets. For detailed theory, refer to the individual method documents.


Clustering Methods

Method Role Strengths Limitations Details
k-means (Lloyd's algorithm) Partition data into kk clusters Fast, intuitive, quality measurable via WCSS Assumes spherical clusters; risk of local optima kmeans.md

k-means Initialization Strategies (Init)

The initial centroid selection method for k-means. Both are internal settings of k-means, not separate clustering methods — the Lloyd's algorithm itself (assign → update → converge) is shared.

Init strategy Description Best for
k-means++ D²-proportional probability sampling (Xoshiro256Plus, fixed seed derived from n · k) Avoid local optima; quality-first
Deterministic Same k-means++ D²-proportional sampling (delegated to linfa), but with a fixed seed (42) Fully reproducible results required

Choosing the Number of Clusters (k)

The Elbow method is an auxiliary tool for k-means, not a clustering method itself. It is used to decide "how many clusters to split into" before running k-means.

Method Role Strengths Limitations Details
Elbow method Auto-estimate optimal kk from the rate of change in WCSS (within-cluster sum of squares) No need for user to specify kk Estimation accuracy decreases when WCSS is smooth elbow.md

Workflow

flowchart TD
    start["Run clustering"] --> sel{"k selection"}
    sel -- "Elbow (Auto)" --> elbowStep["Elbow method exhaustively tries k=2..max_k<br/>and auto-estimates optimal k"]
    elbowStep --> runElbow["Run k-means with estimated k<br/>(applying Init strategy)"]
    sel -- "Manual" --> runManual["Run k-means directly with user-specified k<br/>(applying Init strategy)"]

    init{"Init strategy<br/>(differs only in k-means initialization)"}
    init -- "k-means++" --> initA["D²-proportional probability sampling<br/>(seed derived from n, k)"]
    init -- "Deterministic" --> initB["Same D²-proportional sampling,<br/>seed fixed to 42"]

Choosing the Input Space

Setting Features used Best analysis
Objective Space Objective values only Find trials with similar performance
Variable Space Parameter values only Identify patterns in design variables
Combined Objectives + parameters See joint structure across both spaces

Other structure-revealing tools, available as separate widgets:

  • Dendrogram: hierarchical clustering that builds a full merge tree instead of committing to a single kk upfront
  • PCA Biplot: projects trials and variables onto a standardized 2D principal-component plane
  • SOM Map: a Self-Organizing Map, topology-preserving 2D map complementary to a fixed kk-cluster partition