auditor: Model Audit - Verification, Validation, and Error Analysis

Alicja Gosiewska, Przemysław Biecek, Hubert Baniecki, Tomasz Mikołajczyk, Przemyslaw BiecekOpenalex Unknown 2018 · OpenAlex

Abstract

The auditor package provides an easy-to-use unified interface for creating validation plots for any machine learning model. By automating the generation of residual plots, influence diagnostics, and performance curves, auditor helps researchers avoid the repetitive work of writing custom visualization code. These visualizations allow practitioners to assess and compare the goodness of fit, performance, and similarity of models across different architectures.

Introduction

Model validation is a critical yet often tedious phase of the machine learning workflow. Traditionally, practitioners have had to write repetitive, custom code to generate diagnostic visualizations—such as residual plots, ROC curves, or influence measures—for every new model they develop. This lack of standardization makes it difficult to compare different types of models, such as a Generalized Linear Model (GLM) versus a Random Forest, on a level playing field.

The auditor package addresses this by providing a "Model Audit" framework. It aims to eliminate the "boilerplate" code associated with error analysis, helping users quickly identify model bias, detect influential outliers, and visualize performance trade-offs in a consistent manner. By shifting the focus from simple performance metrics to a holistic audit of model behavior, users can uncover hidden biases that a single accuracy number might miss.

Methods and Implementation

The package operates on a "wrapper" philosophy, primarily integrating with the DALEX ecosystem. It takes a trained model and wraps it into an "explainer" object, which then serves as a standardized input for a suite of diagnostic tools. This standardization is achieved by defining clear requirements for the model, data, and prediction functions.

Parameters for the model audit interface.

Key technical features include:

  • Residual Diagnostics: Automated tests and plots for autocorrelation, trends (using loess fits), and outliers. These tools help identify if the model is systematically underperforming on specific segments of the data.
  • Influence Analysis: Implementation of Cook’s distance to identify observations that disproportionately affect model parameters, which is essential for robust model building.
  • Advanced Visualizations: Beyond standard static graphics, auditor includes interactive D3-based plots (via the r2d3 package) for deeper exploration. Users can hover over specific data points in a residual plot to investigate problematic observations.
  • Model Comparison Tools: Unique visualizations like Radar plots for multi-metric ranking and Principal Component Analysis (PCA) of residuals allow researchers to assess the similarity between different models' error patterns.
  • Comprehensive Scoring: A library of over 30 scoring functions (e.g., Gini coefficient, RMSE, F1 score, REC curves) can be calculated and compared across models.

Key Insights

The "Audit" Philosophy

auditor promotes a shift in perspective. Rather than treating a model as a black box evaluated only by its final output, the package encourages a thorough examination of the distribution and structure of errors. This approach is vital for ensuring model fairness and reliability in production environments.

Model-Agnosticism

Because it utilizes the DALEX explainer interface, auditor works with virtually any model type. This unified interface is essential for modern data science teams working with heterogeneous model ensembles, allowing them to use the same diagnostic suite for a simple linear regression and a complex deep learning model.

Visualizing Error Characteristics

The inclusion of Regression Error Characteristic (REC) curves—a generalization of ROC curves for regression—provides a powerful way to visualize the percentage of predictions within a given error tolerance. This helps stakeholders understand the practical utility of a model beyond abstract error metrics.

Conclusion and Limitations

auditor successfully streamlines the model diagnostic process, providing a one-stop shop for classification and regression validation. It significantly reduces the lines of code required for complex tasks like calculating Durbin-Watson scores or generating PCA plots of residuals.

However, users should be aware of certain limitations. Some advanced diagnostics, specifically Cook’s distance, require the underlying model to support a specific update method, which may limit its use with some niche frameworks. Additionally, the package is heavily tied to the DALEX ecosystem; while this provides necessary standardization, it requires users to adopt the DALEX explainer workflow to access the full suite of auditing tools.

Summary updated

Abstract

Provides an easy to use unified interface for creating validation plots for any model. The 'auditor' helps to avoid repetitive work consisting of writing code needed to create residual plots. This visualizations allow to asses and compare the goodness of fit, performance, and similarity of models.
BibTeX
@inproceedings{gosiewska2018auditor,
  author = {Alicja Gosiewska and Przemysław Biecek and Hubert Baniecki and Tomasz Mikołajczyk and Przemyslaw Biecek},
  title = {{auditor: Model Audit - Verification, Validation, and Error Analysis}},
  booktitle = {Openalex Unknown},
  year = {2018},
  doi = {10.32614/cran.package.auditor},
}
Figure