A fun exercise in Principal Component Analysis (PCA) for dimensionality reduction.

I collected data of different troop attributes in the mobile game, Clash of Clans. These included damage per attack, range, hitpoints etc.

PCA uncovers the main latent traits that differentiates units.

For example, the First Principal Component has a coefficient of 0.48 on hitpoints but -0.16 on range and -0.39 on movement speed. So I interpret this as a measure of “tankiness”, and describes troops like golem and PEKKA.

The Second Principal Component has a coefficient of 0.65 on range but -0.026 on hitpoints. So I interpret this as a measure of “range” and representative of troops such as archers and e-drags.

The results are plotted below.

PCA of Clash of Clans Troop Attributes

PCA of Clash of Clans Troop Attributes

For more details, feel free to visit my GitHub repository linked above.