I ran 580 model-dataset experiments to show that, even if you try very hard, it is almost impossible to know that a model is degrading just by looking at data drift results

<p>

In my opinion, data drift detection methods are very useful when we want to understand what went wrong with a model, but they are not the right tools to know how my model's performance is doing.</p>
<p>Essentially, using data drift as a proxy for performance monitoring is not a great idea.</p>
<p>I wanted to prove that by giving data drift methods a second chance and trying to get the most out of them. I built a technique that relies on drift signals to estimate model performance and compared its results against the current SoTA performance estimation methods (<a href="https://arxiv.org/abs/2401.08348" rel="nofollow">PAPE [arxiv link]</a> and <a href="https://nannyml.readthedocs.io/en/stable/how_it_works/performance_estimation.html#confidence-based-performance-estimation-cbpe" rel="nofollow">CBPE [docs link]</a>) to see which technique performs best.</p>
<p>To effectively compare data drift signals against performance estimation methods, I used an evaluation framework that emulates a typical production ML model and ran multiple dataset-model experiments.</p>
<p>As per data, I used datasets from the <a href="https://github.com/socialfoundations/folktables" rel="nofollow">Folktables package</a>. (Folktables preprocesses US census data to create a set of binary classification problems.) To make sure the results are not biased, in terms of the nature of the model, I trained different types of models (Linear, Ensemble Boosting) for multiple prediction tasks included in Folktables.</p>
<p>Then, I built a technique that relies on drift signals to estimate model performance. This method uses univariate and multivariate data drift information as features of a DriftSignal model to estimate the performance of the model we monitor. It works as follows:</p>
<ol>
<li>Fit univariate/multivariate drift detection calculator on reference data (test set).</li>
<li>Take the fitted calculators to measure the observed drift in the production set. For univariate drift detection methods, we use Jensen Shannon, Kolmogorov-Smirnov, and Chi2 distance metrics/tests. Meanwhile, we use the <a href="https://nannyml.readthedocs.io/en/stable/how_it_works/multivariate_drift.html#data-reconstruction-with-pca" rel="nofollow">PCA Reconstruction Error</a> and <a href="https://nannyml.readthedocs.io/en/stable/how_it_works/multivariate_drift.html#domain-classifier" rel="nofollow">Domain Classifier</a> for multivariate methods.</li>
<li>Build a DriftSignal model that trains a regression algorithm using the drift results from the reference period as features and the monitored model performance as a target.</li>
<li>Estimate the performance of the monitored model on the production set using the trained DriftSignal model.</li>
</ol>
<p>You can find the full implementation of this method in this <a href="https://gist.github.com/santiviquez/aa224c6e232c8bd2534893888981564d" rel="nofollow">GitHub Gist</a>.</p>
<p>Then, for evaluation, I used a modified version of MAE because I needed an aggregated version that take into consideration the standard deviation of the errors. To account for this, I scale absolute/squared errors by the standard error (SE) calculated for each evaluation case. We call the SE-scaled metrics <strong>mean absolute standard error (MASTE)</strong>.</p>
<div class="max-w-full overflow-auto">
<table>
<thead><tr>
<th align="center"><a href="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/WzVQMeFvDXsp7S8VpOTl7.webp" rel="nofollow"><img alt="image/webp" src="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/WzVQMeFvDXsp7S8VpOTl7.webp"/></a></th>
</tr>
</thead><tbody><tr>
<td align="center"><em>MASTE formula</em></td>
</tr>
</tbody>
</table>
</div>
<p>Then it was a matter of running all the 580 experiments and collect results.</p>
<p>Since, each performance estimation method is trying to estimate the roc_auc of the monitored model, I report the MASTE between the estimated and realized roc_auc.</p>
<div class="max-w-full overflow-auto">
<table>
<thead><tr>
<th align="center"><a href="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/oN_W8e9rAMyelY84ItE0e.webp" rel="nofollow"><img alt="image/webp" src="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/oN_W8e9rAMyelY84ItE0e.webp"/></a></th>
</tr>
</thead><tbody><tr>
<td align="center"><em>The methods involved in the analysis are trying to estimate the AUC-ROC of the monitored models. So, after the experiments, we ended up with the estimated and realized AUC-ROC. To compare the error between both, we compute the MASTE (modification of MAE) to evaluate which performance estimation method worked best. That is what this table is reporting.</em></td>
</tr>
</tbody>
</table>
</div>
<p>PAPE seems to be the most accurate method, followed by CBPE. Surprisingly, constant test set performance is the third best. This is closely followed by random forest versions of univariate and multivariate drift signal models.</p>
<p>This plot shows the quality of performance estimation among different methods, including PAPE and CBPE.</p>
<div class="max-w-full overflow-auto">
<table>
<thead><tr>
<th align="center"><a href="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/OvqnLtlYwNAXQIiX0bUJN.webp" rel="nofollow"><img alt="image/webp" src="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/OvqnLtlYwNAXQIiX0bUJN.webp"/></a></th>
</tr>
</thead><tbody><tr>
<td align="center"><em>Quality of performance estimation (MASTE of roc_auc) vs absolute performance change (SE). (The lower, the better).</em></td>
</tr>
</tbody>
</table>
</div>
<p>Here is a specific time series plot of a model's realized ROC AUC (black) compared against all the performance estimation methods. PAPE (red) accurately estimates the direction of the most significant performance change and closely approximates the magnitude.</p>
<div class="max-w-full overflow-auto">
<table>
<thead><tr>
<th align="center"><a href="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/1-tRyEBEIj2-TBoQonETC.webp" rel="nofollow"><img alt="image/webp" src="https://cdn-uploads.huggingface.co/production/uploads/629a173153a72d997d3f57d0/1-tRyEBEIj2-TBoQonETC.webp"/></a></th>
</tr>
</thead><tbody><tr>
<td align="center"><em>Time series plot of realized vs estimated roc_auc for dataset ACSIncome (California) and LigthGBM model.</em></td>
</tr>
</tbody>
</table>
</div>
<p>The experiments suggest that there are better tools for detecting performance degradation than data drift, even though I tried my best to extract all the meaningful information from drift signals to create an accurate performance estimation method.</p>
<p>There are better tools for quantifying the impact of data drift on model performance. So, I hope this helps the industry realize that monitoring fine-grained metrics leads to nothing and that a change in an obscure feature might not mean anything. It is better to first estimate model performance and then, if it drops, review data drift results but not the other way around.</p>
<p>Full experiment set up, datasets, models, benchmarking methods, and the code used in the project can be found in this <a href="https://www.nannyml.com/blog/data-drift-estimate-model-performance" rel="nofollow">longer post</a> that I wrote last week.</p>
