KatInterview

Building a Time-Safe Retention Prediction Model

Machine LearningModel answer
MediumModel answerMachine Learningretentiontemporal-leakagefeature-engineering

Last updated

Design a feature set and validation strategy to predict whether users will remain active, avoiding temporal leakage and quantifying predictive lift.

You are working with two datasets: a user table containing registration timestamp and subscription tier, and an events table with timestamped user actions. Your task is to build a model that predicts whether users will remain active in the future.

You are considering several candidate features:

  • Count of events per user
  • Number of distinct days with activity
  • Subscription tier at registration
  • Day of week when the user signed up

Describe your approach to building and validating this model. Your answer should address:

  1. How you define the prediction problem (what time point are you predicting from, what does "retained" mean, what is the outcome window)
  2. How you construct features that respect temporal boundaries and avoid leakage
  3. How you validate that your features provide genuine predictive signal beyond simple baselines
  4. What evaluation methodology you would use and why

Be explicit about any assumptions you make regarding the retention definition and time windows.

Hints

Hint 1

Define a clear cutoff: features use data before time T, the label uses data after T

Hint 2

Compare your model against a simple baseline like 'predict the overall retention rate for everyone'

Hint 3

Consider what happens when a user has zero events in the feature window