Machine learning case study

Player Segmentation Model

A behaviour-led clustering framework that turns player activity into five clear, actionable audiences for retention, lifecycle and product teams.

Pythonpandasscikit-learnBigQuery
Interactive explorer

Five behaviours.
One usable view.

Select a segment to isolate its representative points and inspect its behavioural profile. The two-dimensional map is a presentation view of scaled behavioural features, not a geographic map or causal model.

Profiles analysed48,000180-day feature window
Behavioural features11Value, frequency & recency
Selected clusters5K-means solution
Silhouette score0.61Validation result

Behavioural cluster map

Player segment cluster map Representative profiles plotted by deposit frequency score and average session value score. Use the buttons above to highlight a segment.

Dots are a deterministic representative sample for visual clarity; profile totals represent the complete case-study population.

Segment profile summary

SegmentPlayersShareSessions / mo.Avg. deposits / mo.90-day retention
Methodology

From raw events to stable audiences.

The workflow separates feature construction, preprocessing, selection and interpretation so the result can be reproduced, reviewed and monitored.

Build the feature mart

Aggregate session, deposit and product events to one row per player in BigQuery, using a fixed 180-day observation window.

Prepare features

Log-transform skewed monetary variables, cap extreme outliers, impute missing values and standardise all model inputs.

Compare solutions

Fit K-means for k=3 to k=8 with a fixed seed and multiple initialisations, then compare separation, stability and usefulness.

Profile & monitor

Name clusters only after reviewing centroids. Track population drift and reassignment stability before operational use.

Model features

Days since last sessionSessions / 30dActive daysDeposit frequencyAverage depositNet revenueAverage stakeProduct diversityBonus use rateSession durationWithdrawal ratio

Quality controls

One row per playerNo future eventsDuplicate checksMissingness reportFixed random seedVersioned pipelineDrift monitoringCluster size threshold
Model evaluation

Useful beats merely optimal.

The highest single score is not enough. The chosen solution should also remain stable across samples, produce meaningful cluster sizes and translate into distinct decisions.

Selected k=5 diagnostics

0.61Silhouette score
0.72Davies-Bouldin index
14,284Calinski-Harabasz score
86%Bootstrap assignment stability

Lower Davies-Bouldin is better; higher values are better for the other three metrics.

Candidate silhouette comparison

k=3
0.54
k=4
0.58
k=5
0.61
k=6
0.57
k=7
0.53
InterpretabilityEach centroid has a clear behavioural story.
StabilityRe-run assignments remain acceptably consistent.
ActionabilityEvery segment maps to a distinct testable action.
Business interpretation

Insights built for action.

Segmentation is descriptive, not causal. These findings are hypotheses for prioritisation; campaign impact still requires consent-aware experimentation and incremental measurement.

01 / RETENTION

Protect loyalty without over-incentivising.

High-Value Loyal profiles represent 11% of the population and show the strongest retention. Their experience should emphasise reliability and relevance.

Test: service-led recognition against standard bonus-led messaging.

02 / GROWTH

Help promising new players form habits.

New Growth profiles have encouraging engagement but lower maturity. Product education and well-timed discovery may be more useful than broad promotions.

Test: personalised onboarding journeys with a holdout group.

03 / REACTIVATION

Detect disengagement before it hardens.

At-Risk profiles show low recent activity despite previous value signals. A light-touch, frequency-capped journey can test whether the decline is reversible.

Test: channel and timing combinations, measured on incremental return.

Want to discuss the analysis?

I can walk through the feature design, model trade-offs and dashboard decisions.