Abstract
Different users can use a given Internet application in many different ways. The ability to record detailed event logs of user in-application activity allows us to discover ways in which the application is being used. This enables personalization and also leads to important insights with actionable business and product outcomes. Here we study the problem of user session categorization, where the goal is to automatically discover categories/classes of user in-session behavior using event logs, and then consistently categorize each user session into the discovered classes. We develop a three stage approach which uses clustering to discover categories of sessions, then builds classifiers to classify new sessions into the discovered categories, and finally performs daily classification in a distributed pipeline. An important innovation of our approach is selecting a set of events as long-tail features, and replacing them with a new feature that is less sensitive to product experimentation and logging changes. This allows for robust and stable identification of session types even though the underlying application is constantly changing. We deploy the approach to Pinterest and demonstrate its effectiveness. We discover insights that have consequences for product monetization, growth, and design. Our solution classifies millions of user sessions daily and leads to actionable insights.
Introduction
In large-scale web applications like Pinterest, understanding user behavior is critical for personalization and strategic decision-making. However, analyzing user sessions via clickstream event logs presents significant challenges. First, high dimensionality: sessions can contain thousands of actions, many of which are rare. Second, the "moving target" problem: frequent A/B tests and UI updates cause event IDs and frequencies to shift, often breaking traditional machine learning models trained on specific event names. This research proposes a robust methodology to categorize sessions accurately while remaining "future-proof" against product churn.
Methodology
The proposed system operates through a three-stage pipeline designed for both discovery and production-scale deployment.
- Cluster Discovery: User sessions are treated as documents where actions (e.g., "repin", "click") are words. Using TF-IDF weighting, the team applies Principal Component Analysis (PCA) for dimensionality reduction followed by K-Medoids clustering to identify natural behavioral groupings.
- Building Classifiers: To transition to real-time scoring, a Random Forest classifier is trained. A key innovation here is the feature split: "Scoring features" represent stable, fundamental actions, while volatile "Long-tail features" are aggregated into a single, normalized "Noise feature." This prevents the model from over-fitting to experimental UI elements.
- Deployment: The system is implemented on a distributed pipeline using Apache Spark and Pinball, processing tens of millions of sessions daily.
Data and Evaluation
The study utilized Pinterest’s internal event logs, specifically focusing on a sample of 8.2 million sessions from July 2016 for primary analysis. Models were trained on samples of 500,000 sessions with a 1/3 holdout set. To evaluate long-term stability, the methodology was tested across six months of data to ensure the categorization remained consistent despite interface changes.
Key Insights and Results
The researchers identified seven major session types, including Browse, Clickthrough, Notification, Retrieval, Repin, Search, and Noise. Analysis revealed that user intent correlates strongly with content; for instance, "Clickthrough" sessions (high intent) often involve practical content like recipes. From a business perspective, revenue is non-uniform, with specific browsing categories (C1) and Clickthroughs generating significantly higher revenue per session.
The Random Forest classifier achieved over 85% prediction accuracy. Crucially, the "Noise feature" strategy ensured remarkable stability. Despite hundreds of product experiments occurring simultaneously, the proportion of session categories remained consistent over time.
Limitations and Future Work
While the model is robust, the authors recommend retraining every three months to ensure "Scoring features" remain relevant. Future work includes analyzing user "journeys" by tracking transitions between session types over longer periods and developing early-prediction models to personalize the UI within the first few actions of a session.
Summary updated