Problem
In digital advertising, a segment is usually gender plus one age bucket (<18, 18-24, 25-34, 35-44, 45-54, 55-64, 65+). Demand-side platforms (DSPs) receive ad requests from every site that sells ad space, about 200,000 per second. For a request they know only an anonymous cookie id, the site's domain, IPs, request counts and device data, not who the person is. The task is to restore gender and age from these traces.
Example from the article: a semi-synthetic table of ad requests per cookie (domain, region, device, price estimate, date, part of day, request count) with known gender and age for part of the cookies.
Solution in brief
Skip hand-made features and treat the task as a recommender problem. Build a cookie-by-domain matrix of request counts, factorize it with ALS into 50 factors, and train a default CatBoost classifier on the user vectors, once for gender and once for the seven age buckets. This baseline gets Gini 0.665 for gender and weighted F1 0.41 for age, and a combined score of 1.485.
Questions this case answers
- How to infer demographic attributes of anonymous users from their visit counts per site when no profile data is available
- How to represent users as dense vectors from a sparse user-by-item count matrix to feed a standard classifier
- How to estimate a user's gender and age bucket from the list of sites they visit when the only id is an anonymous cookie?
- How to get a usable user embedding from browsing logs without hand-made feature engineering?
Tools and methods
- ALS (implicit, FAISS-based) — factorizes the user-domain matrix into user embeddings
- CatBoost — classifiers for gender and age, default settings
- SciPy sparse COO matrix — holds user-by-domain request counts
- Gini and weighted F1 — metrics for gender and age, combined into one score
Google or a one-time email code. No password.