Maximizing Online Predictions Accuracy
Table of Contents
- Introduction
- Online Predictions
- Batch Predictions
- Online Predictions with Batch Features
- Online Predictions with Online Features
- Monitoring Solutions
- Monitoring Business Metrics
- Monitoring Predictions
- Monitoring Features
- Challenges of Feature Monitoring
- In-Memory Cost
- False Alarms
- Schema Expectations
- Choosing a Future Store for Small Teams
- Scaling Serving with a Large Number of Models
- Monitoring Drift for a Large Number of Models
- Conclusion
Online Predictions
Online predictions are becoming increasingly popular in industries as they move towards prediction and Continual learning. In this section, we will discuss the different types of online predictions and how they are used.
Batch Predictions
Batch predictions refer to the computation of predictions at regular intervals, such as once a day. The problem with batch predictions is that they are not adaptable to real-time requests, as Relevant information may not be taken into account. Additionally, batch predictions often result in wasted computing power, as many predictions are not utilized.
Online Predictions with Batch Features
Online predictions with batch features involve computing predictions using features that are computed offline. For example, for session-Based recommendation systems, all the products that a user has seen in the last 30 minutes are considered as batch features. These batch features are pre-computed and loaded into a key-value store to reduce latency during prediction time.
Online Predictions with Online Features
Online predictions with online features involve computing predictions using features that are computed online. For tasks such as calculating product trends, it is necessary to compute online features, such as the number of views a product has had in the last 30 minutes. These online features are computed on demand, using streaming data sources, such as click streams. This allows for real-time predictions based on up-to-date information.
Monitoring Solutions
Monitoring solutions are crucial for ensuring the accuracy and effectiveness of machine learning models. In this section, we will explore different monitoring techniques for business metrics, predictions, and features.
Monitoring Business Metrics
Business metrics, such as accuracy and click-through rate, are important indicators of the performance of machine learning models. However, monitoring these metrics directly can be challenging, as they often require labeled data or user feedback. To overcome this, companies often monitor proxies, such as predictions and features, which can give insights into the performance of the models.
Monitoring Predictions
Monitoring predictions involves tracking the distribution of predictions and detecting any shifts or anomalies. By monitoring changes in prediction distributions, companies can identify potential issues or biases in their models. Proxy monitoring techniques, such as comparing statistics and using two-sample hypothesis testing, are commonly used to detect shifts in prediction distributions.
Monitoring Features
Monitoring features involves tracking the distribution and values of computed features. Features play a crucial role in machine learning models, and any changes in their distribution can impact the accuracy and effectiveness of the models. Companies often compute expected statistics or schemas for features during training and monitor changes in these statistics or schemas during production to detect feature drift.
Challenges of Feature Monitoring
Monitoring features can pose several challenges that need to be addressed for effective monitoring.
In-Memory Cost
Computing and storing statistics for a large number of features can be computationally expensive and memory-intensive. This becomes critical when there are multiple models in production, each with a large number of features. Optimizing memory usage and computation cost is essential to Scale feature monitoring efficiently.
False Alarms
Monitoring a large number of features increases the likelihood of false alarms. Minor changes or fluctuations in feature values may trigger unnecessary alerts. Implementing effective alarms and thresholds is crucial to distinguish between significant feature drift and normal fluctuations.
Schema Expectations
Features often have expected schemas or distributions that need to be monitored during production. However, these expectations may change over time as models are updated or new data is incorporated. Keeping track of evolving feature schemas and detecting any deviations is vital to ensure consistent and accurate feature monitoring.
Choosing a Future Store for Small Teams
For small teams, choosing a suitable feature store is crucial. Depending on the complexity of the features and integration timelines, different feature store solutions may be considered. Options range from using in-house solutions for simpler features to leveraging stream processing tools, such as Apache Flink or Apache Kafka, for more complex streaming features.
Scaling Serving with a Large Number of Models
Scaling serving with a large number of models can pose unique challenges. When the scale is not determined by the number of requests but rather by the number of models to serve, a custom serving solution that can handle multiple models efficiently may be required. Building a scalable serving infrastructure that can manage and serve thousands of models simultaneously is essential for smooth operations.
Monitoring Drift for a Large Number of Models
Monitoring drift for a large number of models requires efficient and near real-time monitoring techniques. With thousands of models in production, keeping track of model performance and detecting drift can be challenging. Utilizing techniques such as merge profiles and automated root cause analysis can help manage and monitor drift across a wide range of models effectively.
Conclusion
Monitoring online predictions and features is crucial for ensuring the accuracy and effectiveness of machine learning models. By leveraging suitable monitoring solutions and feature stores, companies can detect distribution shifts, track feature drift, and make informed decisions for model improvements. Scaling serving infrastructure and monitoring drift for a large number of models pose unique challenges but can be addressed with proper system design and monitoring techniques.