The idea behind a propensity score is simple. You want to know how likely each visitor is to subscribe, book, or ask for a demo, so the site can make a different offer to the people it would help.
Building, training and serving one is the hard part. A data team writes pipelines that turn raw events into features, builds a training set from past visits, and trains a model. Then it writes every feature again so the app can compute it live. Any of those steps can make the score wrong without an error, because the score still comes back as a confident number.
Imagine a news site trying to predict which readers will subscribe. Below are four of those problems, each with an example from that site and how Signals handles it.
Problem 1: scores computed in a nightly batch
Many propensity scores are computed in batch, once a day or once a week. Between runs the score can’t change, so nothing a visitor does on the current visit counts. The visits where someone is close to deciding are the ones a batch score gets wrong.
Priya has read one free article a month for a year, so last night’s batch gave her a low propensity to subscribe. This morning she hits the paywall three times in ten minutes and opens the pricing page. Each time, the site reads last night’s score and shows the standard paywall. She closes the tab.
Signals computes the score when your app asks for it, from the visitor’s attributes at that moment. Each paywall hit raises Priya’s paywall count, and her score rises with it.
Problem 2: data leakage in the training set
Data leakage is when a training row includes information from after the moment it describes. The model learns a pattern that only exists because the outcome had already happened. It scores well in testing and badly in production, where that information isn’t there yet.
On the news site, only subscribers get the newsletter. The data team built the training set in September, counting each reader’s newsletters opened up to that day. Leo subscribed in March and has opened 30 since, so his row says 30 newsletters and subscribed. The model learns that newsletter readers subscribe. In production, every reader it scores hasn’t subscribed yet, so every one of them has a newsletter count of zero.
Signals builds each training row from only the events before the moment that row describes. Leo’s row is counted up to just before he subscribed, when his newsletter count was zero.
Problem 3: training-serving skew
Training-serving skew is when a feature is computed one way for training and another way for the live score. It happens when the same feature is written twice, in separate code, and nothing checks that the two agree. The model then gets live inputs that don’t mean what they meant in training.
On the news site, the data team and the app team each wrote an articles_read feature. The data team’s version, used for training, counts every article opened. The app team’s version, used for the live score, counts only articles read to the end. Marcus opens about 40 articles a week and finishes 2. The live app sends 2 where the model expects a count of articles opened, so it scores him as someone who barely visits.
In Signals, training and the live score read the same articles_read attribute, so the model gets 40 for Marcus in both.
Problem 4: months from request to a live score
A propensity score needs feature pipelines, a backfill, a training set, a model, a serving API, and a job that keeps the live features matching the training ones. Each is its own piece of engineering. Teams without data scientists or ML engineers to spare often never get a score live, and teams that have them can wait months.
Say the site’s growth lead asks for a propensity to subscribe in January, to target offers in the spring sale. The score goes live in July, after the sale has ended.
In Signals, a score is three steps in Console: define it, train it, and publish it.
The options today
Teams that want a propensity score today usually take one of three routes, and each leaves some of these problems in place:
- Analytics and marketing tools that offer propensity scores train the model for you. Many recompute the score on a schedule, so it doesn’t change during the visit.
- On-site personalization tools score during the visit. The model runs inside the vendor’s platform on data from the vendor’s tag, so you usually can’t see the training data or choose the inputs, and only that tool’s own experiences can use the score.
- Building it yourself on a warehouse and a feature platform gives you the data and the model. It also gives you the training set, the serving path and the job of keeping them in sync, which is where data leakage, training-serving skew and the months of work come from.
Four questions to ask about the score you have
None of these problems throws an error. The score keeps coming back, offers go to the wrong visitors, and the ones who were ready to act see the standard page. These questions find each problem:
- When was the score computed? If it was last night, it ignores everything the visitor has done today, including the visits where they’re closest to deciding.
- Could any training row see the future? Every input should be counted up to the moment the row describes, not up to the day the training set was built. If one input looks too good in testing, check it for leakage first.
- Is each input defined once? If training and the live app compute the same feature in separate code, compare their values for a few real visitors. Any difference is skew.
- How long would a new score take? If the answer is months, the campaign or launch that needed it may be over before the score is live.
Predictive attributes in Snowplow Signals
We’ve released predictive attributes in Snowplow Signals to solve these problems. Signals builds the training set in your warehouse from your own events, keeps one definition of each input for training and live scoring, and scores visitors in real time while they’re still on the site. Any app can ask for the score, and you can build and deploy a propensity model in minutes, not months. Announcing predictive attributes in Snowplow Signals shows how.