03 - Unsupervised Clustering of Playstyles

Executive Summary

Professional CS2 roles describe how players take space, trade, and position. This notebook asks a simpler upstream question: do those behaviours form natural groups in feature space without using the role labels, and if so, how well do the groups match the labels experts already assign?

Key findings

  • Playstyles form soft groups. Using the same Orthogonal feature set as classification (behavioural stats plus isolation and centrality residuals), Ward and Gaussian Mixture models recover coherent structure. Silhouette at $k=3$ is about 0.17-0.18 on T-side and 0.14-0.15 on CT-side: real separation, but with overlap rather than hard walls between styles.
  • Those groups line up with roles, especially on T-side. At $k=3$, Adjusted Rand Index (ARI) is 0.68 (Ward) and 0.61 (GMM) on T-side, versus 0.31 and 0.30 on CT-side. Chance agreement is ~0, so both sides show a real link; T-side agreement is roughly twice as strong.
  • T-side roles look like three attack-side archetypes. Contingency tables and dendrograms largely recover Spacetaker, Lurker, and AWPer as separate blocks. CT-side clusters are weaker: Anchors separate more cleanly than Rotators and AWPers, who mix more often.
  • Soft assignments show the hybrids. GMM responsibilities highlight boundary players whose mass is split across components, which matches the CT Rotator-AWPer porosity already seen in supervised classification.
  • Model choices are transparent. We fix $k=3$ because each side has three core roles, and the silhouette curves are compatible with that scale (they do not uniquely demand it). GMM covariance is chosen by BIC at $k=3$: tied on T-side, spherical on CT-side.

Bottom line: Core playstyles cluster naturally and agree with expert roles, with clearer structure on T-side than CT-side, consistent with the classification results.

Analyses are run separately for T and CT. Ambiguous hybrid labels (Half-Lurker on T, Mixed on CT) are removed before fitting so the geometry reflects core archetypes.


Objectives

1. Build the analysis cohort
Filter to stable players, introduce the Orthogonal features, exclude hybrid roles, and scale the matrices used for clustering.

2. Check whether playstyle space clusters
Measure how cohesive partitions are across a range of $k$, choose GMM covariance by BIC, and fit final Ward and GMM models at $k=3$.

3. Link clusters to expert roles
Quantify agreement with ARI, inspect cluster × role counts, and compare T-side vs CT-side distinctness.

4. Inspect geometry and soft structure
Use 3D PCA, Ward dendrograms, and GMM responsibilities to see which roles sit nearest each other and which players sit on boundaries.

5. Synthesise
Summarise what the unsupervised evidence says about CS roles and where the analysis is limited.

1. Setup and Experimental Design

Purpose: Load the processed player dataset, define the feature space, and build the scaled T-side and CT-side matrices that every later section will use.

Methodology notes

Cohort

  • Keep players with map_count ≥ 40 (same stability threshold as EDA and classification; $N=84$ before role filtering).
  • Drop rows missing the side-specific role or any clustering feature.
  • Exclude hybrid roles before scaling and fitting: Half-Lurker on T-side, Mixed on CT-side. Expected core sizes are about 72 (T) and 66 (CT).

Feature space (Orthogonal) Behavioural and positional metrics, matching the champion feature set from classification:

Short name Full name What it captures
TAPD Time Alive Per Death Survival / how quickly a player dies
OAP Opening Attempt Percentage Tendency to take opening duels
PODT Proportion of Deaths Traded How often deaths are traded by teammates
POKT Proportion of Kills that were Trades How often kills come from trades
ADNT Average Distance from Nearest Teammate Isolation from the closest teammate
ADAT (R) ADAT residual given ADNT Central vs peripheral positioning after accounting for isolation

We use ADNT + the ADAT residual rather than raw ADAT so positioning is not double-counted: ADNT and ADAT are highly correlated in EDA, while ADNT and the residual are essentially uncorrelated. Full definitions also appear in the EDA notebook / data documentation.

Algorithms

  • Ward agglomerative clustering: hard partitions that minimise within-cluster variance (Euclidean distance on scaled features).
  • Gaussian Mixture (GMM): soft assignments; covariance type chosen by BIC among spherical, diagonal, and tied at $k=3$.

Scaling StandardScaler is fit on each side's filtered cohort. There is no train/test split for the main unsupervised fit.

(WindowsPath('P:/cs2-playstyle-analysis-2024'),
 WindowsPath('P:/cs2-playstyle-analysis-2024/data/processed/cs2_playstyles_2024_with_residuals.parquet'),
 WindowsPath('P:/cs2-playstyle-analysis-2024/results/clustering/figures'),
 WindowsPath('P:/cs2-playstyle-analysis-2024/results/clustering/tables'))

Load dataset and build side matrices

Filter to the stable cohort, drop hybrid roles, and scale the Orthogonal features for each side.

Raw rows: 306
Players with map_count ≥ 40: 84

T Orthogonal features (6):
  TAPD        (tapd_t)
  OAP         (oap_t)
  PODT        (podt_t)
  POKT        (pokt_t)
  ADNT        (adnt_rank_t)
  ADAT (R)    (adat_residual_t)
TAPD: Time Alive Per Death
OAP: Opening Attempt Percentage
PODT: Proportion of Deaths Traded
POKT: Proportion of Kills which were Trades
ADNT: Average Distance from Nearest Teammate
ADAT (R): Residual from ADAT predicted by ADNT

CT Orthogonal features (6):
  TAPD        (tapd_ct)
  OAP         (oap_ct)
  PODT        (podt_ct)
  POKT        (pokt_ct)
  ADNT        (adnt_rank_ct)
  ADAT (R)    (adat_residual_ct)
TAPD: Time Alive Per Death
OAP: Opening Attempt Percentage
PODT: Proportion of Deaths Traded
POKT: Proportion of Kills which were Trades
ADNT: Average Distance from Nearest Teammate
ADAT (R): Residual from ADAT predicted by ADNT

Excluded hybrid roles: {'t': 'Half-Lurker', 'ct': 'Mixed'}
side n n_features excluded_role role_counts
0 T 72 6 Half-Lurker {'Spacetaker': 31, 'Lurker': 24, 'AWPer': 17}
1 CT 66 6 Mixed {'Rotator': 28, 'Anchor': 21, 'AWPer': 17}
T: N=72, feature matrix shape=(72, 6)
Spacetaker    31
Lurker        24
AWPer         17
Name: count, dtype: int64
CT: N=66, feature matrix shape=(66, 6)
Rotator    28
Anchor     21
AWPer      17
Name: count, dtype: int64

After exclusions we have 72 T-side players (Spacetaker 31 / Lurker 24 / AWPer 17) and 66 CT-side players (Rotator 28 / Anchor 21 / AWPer 17), each described by six scaled Orthogonal features.

2. Does Playstyle Space Cluster?

Purpose: Before comparing clusters to roles, check whether the feature space has any coherent multi-group structure, choose a GMM covariance form, and lock the final models used in the rest of the notebook.

We sweep silhouette over $k \in \{2..6\}$ for Ward and GMM. Silhouette asks how similar each player is to their own cluster versus neighbouring clusters (higher is better). Modest values are expected here: roles share maps and often bleed into neighbouring styles.

Methodology notes

Why silhouette as the main curve Davies-Bouldin often keeps looking "better" as $k$ rises because within-cluster scatter shrinks when clusters get smaller. That bias toward higher $k$ is unhelpful for choosing a role-aligned scale, so DB stays in the saved tables only.

GMM covariance At fixed $k=3$, compare BIC for spherical, diagonal, and tied covariances and take the minimum. Full covariance is omitted here: with $N \approx 66$-$72$ and six features, per-component full matrices are heavy relative to the sample.

Order

  1. Pick covariance by BIC at $k=3$.
  2. Sweep silhouette with that covariance locked for GMM.
  3. Fit final Ward + GMM at $k=3$.
==================================================
GMM BIC at k=3 (T)
==================================================
covariance_type bic aic
0 tied 1247.29 1153.94
1 spherical 1253.30 1200.94
2 diag 1265.51 1179.00
Chosen covariance: tied

==================================================
GMM BIC at k=3 (CT)
==================================================
covariance_type bic aic
0 spherical 1172.78 1122.42
1 diag 1202.59 1119.38
2 tied 1204.02 1114.24
Chosen covariance: spherical

Saved BIC table → P:\cs2-playstyle-analysis-2024\results\clustering\tables\gmm_bic_covariance_k3.csv
Chosen GMM covariance by side: {'t': 'tied', 'ct': 'spherical'}

Covariance choice

On T-side, tied covariance wins (BIC ≈ 1247), ahead of spherical (≈ 1253) and diagonal (≈ 1266). Tied means all three components share one covariance matrix: the clusters differ mainly in location, with a common shape for how playstyle features co-vary. That fits a picture of three attack-side archetypes sitting in different regions of a similar behavioural cloud.

On CT-side, spherical wins clearly (BIC ≈ 1173 vs ≈ 1203-1204 for the others). Spherical components are isotropic: each cluster is a ball in scaled feature space. That is a more constrained geometry and is consistent with softer, less elongated CT role structure.

Saved internal metrics (silhouette + DB) → P:\cs2-playstyle-analysis-2024\results\clustering\tables\internal_metrics_vs_k.csv
side algorithm k silhouette davies_bouldin
0 t ward 2 0.161 1.971
1 t ward 3 0.173 1.635
2 t ward 4 0.190 1.511
3 t ward 5 0.187 1.460
4 t ward 6 0.178 1.425
5 t gmm 2 0.159 1.930
6 t gmm 3 0.183 1.593
7 t gmm 4 0.162 1.710
8 t gmm 5 0.158 1.657
9 t gmm 6 0.141 1.552
10 ct ward 2 0.166 1.984
11 ct ward 3 0.144 1.936
12 ct ward 4 0.159 1.715
13 ct ward 5 0.161 1.544
14 ct ward 6 0.174 1.478
15 ct gmm 2 0.164 1.834
16 ct gmm 3 0.150 1.596
17 ct gmm 4 0.122 2.051
18 ct gmm 5 0.054 1.448
19 ct gmm 6 0.131 1.520

Reading the silhouette curves

Values sit in a modest band (~0.14-0.19). That is the statistical signature of overlapping playstyles: Spacetakers and aggressive Rotators are not miles away from everyone else, and AWPers share some behavioural DNA with other roles.

On T-side, both Ward and GMM look reasonable around $k=3$-$4$ (GMM silhouette peaks at $k=3$). On CT-side, the curves are flatter and slightly softer at $k=3$; Ward even prefers other small $k$ on silhouette alone. We therefore treat $k=3$ as compatible with the data and aligned with the three core roles per side, not as a unique optimum discovered by the curve.

Final models at $k=3$

Lock $k=3$ (Spacetaker / Lurker / AWPer on T; Anchor / Rotator / AWPer on CT) and fit Ward plus the BIC-chosen GMM on each side. Cluster IDs (0, 1, 2) are arbitrary labels from the algorithm; later tables annotate each ID with its majority expert role for readability.

k = 3
GMM covariance: {'t': 'tied', 'ct': 'spherical'}
T: Ward sizes=[34, 25, 13], GMM sizes=[26, 22, 24], cov=tied
CT: Ward sizes=[21, 24, 21], GMM sizes=[31, 31, 4], cov=spherical

3. Do Clusters Agree with Expert Roles?

Purpose: Measure how well the unsupervised partitions recover the role labels, and whether that agreement is stronger on T-side than CT-side (as classification suggested).

We use Adjusted Rand Index (ARI) only: it is chance-corrected, so random partitions score near 0. Roles were not used when fitting the clusters; they enter only here as an external check.

Methodology notes

ARI compares two labelings of the same players (cluster ID vs role_t / role_ct). We also plot ARI across $k$ to see whether role agreement peaks sharply at 3 or stays relatively flat. A flat curve would mean the role link is real but does not by itself pick a unique $k$.

ARI at k=3:
side algorithm k ari n covariance_type
0 T ward 3 0.679 72 None
1 T gmm 3 0.614 72 tied
2 CT ward 3 0.310 66 None
3 CT gmm 3 0.300 66 spherical
side T CT
algorithm
gmm 0.614 0.30
ward 0.679 0.31
Mean ARI by side: T=0.647, CT=0.305

ARI at $k=3$

T-side CT-side
Ward 0.68 0.31
GMM 0.61 0.30

T-side clusters recover expert roles well: a player’s unsupervised group usually matches Spacetaker, Lurker, or AWPer. CT-side agreement is still above chance but much weaker. That side contrast matches classification, where T roles were nearly linearly separable and CT roles needed softer, non-linear boundaries with more Rotator-AWPer confusion.

side algorithm k ari
0 t ward 2 0.470
1 t gmm 2 0.272
2 t ward 3 0.679
3 t gmm 3 0.614
4 t ward 4 0.528
5 t gmm 4 0.709
6 t ward 5 0.423
7 t gmm 5 0.553
8 t ward 6 0.395
9 t gmm 6 0.422
10 ct ward 2 0.126
11 ct gmm 2 0.294
12 ct ward 3 0.310
13 ct gmm 3 0.300
14 ct ward 4 0.257
15 ct gmm 4 0.120
16 ct ward 5 0.187
17 ct gmm 5 0.062
18 ct ward 6 0.195
19 ct gmm 6 0.119

ARI across $k$

On T-side, Ward ARI peaks at $k=3$ (0.68). GMM is high at $k=3$ (0.61) and can be slightly higher near $k=4$ (~0.71), so role agreement is strong but not a razor that uniquely selects three components. On CT-side, ARI stays lower across the sweep and is highest near $k=2$-$3$ depending on the algorithm. Together with the silhouette curves, this supports keeping $k=3$ as a role-theory choice that the data can live with, rather than claiming the metrics discovered it alone.

Cluster × role counts

The tables below show how many players of each expert role land in each cluster. Row labels include the majority role so the arbitrary IDs are easier to read. Look for diagonal blocks (clean role recovery) versus split columns (roles that straddle clusters).

T · WARD
role Spacetaker Lurker AWPer
cluster
0 29 2 3
1 2 22 1
2 0 0 13
T · GMM
role Spacetaker Lurker AWPer
cluster
0 9 0 17
1 21 1 0
2 1 23 0
CT · WARD
role Anchor Rotator AWPer
cluster
0 1 17 3
1 18 3 3
2 2 8 11
CT · GMM
role Anchor Rotator AWPer
cluster
0 2 24 5
1 15 4 12
2 4 0 0

T-side: Ward recovers three familiar blocks: a Spacetaker-majority cluster, a Lurker-majority cluster, and a nearly pure AWPer cluster. GMM tells a similar story, with a little more Spacetaker spill into the AWPer-leaning component. That spill is plausible in-game: some entry-oriented riflers share aggression and mid-range positioning patterns with AWPers.

CT-side: Structure is messier. Ward roughly separates an Anchor-heavy group and a Rotator-heavy group, while AWPers spread across clusters and share space with Rotators. GMM also isolates a Rotator-led component, but mixes Anchors with AWPers in another and leaves a small residual component. This is the unsupervised version of the classification finding that CT role boundaries, especially Rotator vs AWPer, are porous.

4. Geometry in 3D PCA

Purpose: Project the six scaled features to three principal components so we can see whether roles and cluster labels occupy distinct regions of playstyle space.

Use the buttons to colour the same embedding by expert role, Ward cluster, or GMM cluster. Hover a point for player name, role, both cluster IDs, and the player’s strongest GMM responsibility.

Saved interactive PCA (T) → P:\cs2-playstyle-analysis-2024\results\clustering\figures\pca3d_t.html
Saved interactive PCA (CT) → P:\cs2-playstyle-analysis-2024\results\clustering\figures\pca3d_ct.html

On T-side, colouring by role already shows three loose clouds; switching to Ward or GMM colours usually preserves that separation, which is why ARI is high. On CT-side, role colours interleave more, and cluster colours carve the cloud differently without lining up as cleanly with Anchor / Rotator / AWPer. The embedding is a view of the same Orthogonal space used for clustering, not a separate algorithm.

5. Dendrograms and Soft Assignments

Forgive the rather wild set of colours used here, it has been done so to make the clusters and players maximally distinguishabl

5.1 Ward dendrograms

Purpose: Show the merge order of players in playstyle space and where a $k=3$ cut falls. Leaf name colour is the expert role; branch colour below the cut follows the Ward cluster palette used elsewhere.

On T-side, same-role leaves often merge early: Lurkers group with Lurkers, Spacetakers with Spacetakers, before the higher cut joins the three archetypes. Late merges between Spacetaker-like and AWPer-like branches explain the small amount of cross-loading in the contingencies.

On CT-side, role colours are more interlaced under the cut. Anchors still form recognisable early clumps, but Rotators and AWPers intertwine sooner, which is the hierarchical view of the same porosity ARI and the heatmaps already quantified.

5.2 GMM soft assignments

Purpose: Show how confidently each player belongs to their GMM component, and where probability mass leaks into other components. Players are grouped by hard cluster assignment along the x-axis; role-coloured name pills encode the expert role so cluster composition is readable at a glance.

Solid bars are players the GMM treats as clear members of one component. Split bars are the interesting cases: riflers who sit between entry and AWPing patterns on T-side, or CT players whose responsibilities straddle Rotator and AWPer components. Those soft boundaries are part of the finding. Professional roles are labels on a continuous playstyle space, not sealed boxes.

6. Synthesis

Playstyles cluster. Orthogonal behavioural and positional features support a soft multi-group structure on both sides. Silhouette values are modest because the groups overlap, which matches how roles are played in CS.

Clusters recover roles, more so on T-side. At $k=3$, ARI is about 0.61-0.68 on T-side versus about 0.30-0.31 on CT-side. Contingencies, dendrograms, and PCA agree: Spacetaker, Lurker, and AWPer emerge as distinct attack-side blocks, while CT-side Rotators and AWPers mix more and Anchors separate more cleanly.

That side contrast lines up with classification. Supervised models found T roles nearly linearly separable and CT roles harder, with Rotator-AWPer confusion. Clustering reaches the same qualitative conclusion without using role labels during fitting.

$k=3$ is a reasoned choice, not a unique discovery. Silhouette and ARI are compatible with three groups, but some curves prefer neighbouring values of $k$. We keep three clusters because each side has three core roles and the unsupervised evidence does not contradict that scale.

Limitations

  • Sample sizes are small ($N \approx 66$-$72$ per side), so individual cluster memberships can shift under resampling. A bootstrap stability check is left for later work.
  • Excluding Half-Lurker and Mixed before fitting clarifies core archetypes but changes the population. Fitting on all players with map_count ≥ 40 and then scoring agreement is a natural sensitivity analysis we have not run here.
  • Cluster IDs are arbitrary; majority-role annotations are only an interpretive aid.
  • BIC covariance selection is ordinary unsupervised model selection on the same sample used for fitting; the candidate set is kept small on purpose.

Overall, the unsupervised evidence supports a simple claim: professional playstyles form soft natural clusters that track expert roles, with sharper structure on the T-side than the CT-side.


Figures and tables for this notebook are saved under results/clustering/figures/ and results/clustering/tables/.