Target in Sight: Three Solutions to the Task of Building a Predictive ML Model

31 Oct 2022

Problem

A product team wants to predict the probability that a user performs a target action from their clickstream. The input is unstructured: text tokens, hashed URLs and sequences of sessions. Positives are rare, and the data has gaps and noise. The usual bag-of-words representation turns 10 thousand unique words into 10 thousand features, which makes the model slow and heavy. VK set it as a 48-hour case at the "Digital Breakthrough" hackathon (26–28 August).

Example from the article: the task mirrors how VK predicts target actions to customize the social network feed.

Solution in brief

All three winning teams replaced bag of words with a smaller dense representation: cleaned and merged tokens, pretrained or self-trained embeddings, and a compact set of frequency, embedding and topic features. A gradient boosting model (CatBoost) then trained on these features. The best team won on preprocessing quality; the second team reached ~0.72 by combining several embeddings.

Questions this case answers
  • How to predict a rare target action from unstructured event tokens and hashed URL sequences when a bag-of-words matrix is too large, sparse and noisy to train on
  • How to predict whether a user will perform a target action from clickstream tokens, URLs and session sequences?
  • How to turn raw text tokens and hashed URLs into a compact feature set when bag of words makes the feature space huge?
  • How to build a first strong baseline for a binary classifier on noisy, imbalanced text-like event data in 48 hours?

Tools and methods

  • Pretrained token embeddings (navic, LaBSE, Distilrubert) — turn tokens into vectors that carry meaning across spellings and languages
  • Word2vec on session sequences — embed hashed URLs with their order and context
  • SVD, LDA, BigARTM — compress tokens and URLs into topic or latent features
  • CatBoost / CatBoostClassifier — final model, supports embeddings and text features
  • StratifiedKFold, feature selection — validation on a rare class and removal of useless features
  • Cloud ML Platform (JupyterHub, MLflow) — environment given to teams
Continue reading — it's free

Google or a one-time email code. No password.