Accumulated local effects (ALE) is a technique in explainable artificial intelligence used to quantify how individual features contribute to the predictions of a machine learning model. Unlike simpler methods that average predictions directly, ALE computes the average change in the model's output as a feature varies within local windows, holding other features at their observed conditional values. This approach produces more realistic estimates of feature effects, especially when predictors are correlated, and avoids the pitfalls of extrapolating to unlikely data combinations.
ALE was developed as an alternative to partial dependence plots (PDP) and marginal plots (M-plot), which can be misleading when features are not independent. By using the conditional distribution of features, ALE generates augmented data that reflects the actual relationships in the training set, rather than assuming all feature combinations are equally probable. This makes ALE particularly valuable for interpreting complex models in fields such as finance, healthcare, and marketing, where correlated inputs are common.
Core Methodology
The central idea of ALE is to measure the local effect of a feature by comparing predictions for data points that differ slightly in that feature, while keeping other features at their observed values. Formally, for a given feature \(x_j\), the ALE plot partitions the range of \(x_j\) into intervals (often called windows). For each interval, the algorithm takes all training instances that fall within that interval and computes the difference in the model's prediction when \(x_j\) is set to the interval's upper bound versus its lower bound, while other features remain unchanged. The average of these differences over all instances in the interval gives the local effect for that window. Accumulating these local effects across intervals yields the ALE curve, which shows how the prediction changes as \(x_j\) moves from its minimum to maximum observed value.
This differencing approach is a key distinction from PDP, which averages the predictions themselves over a grid of feature values. By averaging differences, ALE cancels out the influence of correlated features that may vary systematically with \(x_j\). For instance, in a model predicting house prices, size and number of bedrooms are often correlated. PDP might attribute part of the size effect to the number of bedrooms, but ALE isolates the marginal contribution of size by comparing houses of similar characteristics except for size.
Handling Correlated Predictors
One of the primary advantages of ALE over PDP and M-plots is its robustness to correlated predictors. PDPs assume that features are independent, so they generate synthetic data points that may lie far outside the actual data distribution, leading to unreliable predictions. M-plots, on the other hand, average predictions over the conditional distribution but can still be biased because they average predictions, not differences. ALE avoids these issues by using the conditional distribution and computing differences, which effectively removes the effect of correlated features that do not change within the local window.
For example, consider a model that predicts fuel efficiency based on engine size and vehicle weight, which are strongly correlated. A PDP for engine size would vary engine size while holding weight constant, but such combinations rarely occur in real data, causing the model to extrapolate. ALE, however, compares vehicles with similar weights but different engine sizes, providing a more realistic estimate of the engine size effect.
Example: House Price Prediction
To illustrate, suppose a model predicts house prices based on distance from city center and building area. These two features are often correlated: houses closer to the center tend to be smaller. ALE for building area would partition the area range into intervals, say 50-100 m², 100-150 m², etc. For each interval, it selects houses within that area range, then for each house, it computes the prediction difference when the area is set to the interval's upper bound versus the lower bound, while keeping distance unchanged. Averaging these differences gives the local effect of area for that interval. Accumulating these effects across intervals produces a curve that shows how price changes with area, independent of distance. This separates the impact of size from the correlated distance feature, which is impossible with PDP.
Limitations and Challenges
Despite its strengths, ALE has several limitations. First, the choice of evaluation windows (the number and size of intervals) is subjective and can influence the resulting plot. Too few windows may miss local variations, while too many can lead to noisy estimates. Second, while ALE handles moderate correlations well, extremely high correlations between features can still defeat the technique, because the conditional distribution may become ill-defined or the local differences may be based on very few data points. Third, ALE requires a sufficient number of uniformly distributed observations across the feature range to reliably estimate the conditional distribution. In regions with sparse data, the local effects may be unreliable. This issue becomes more pronounced in high-dimensional settings, where the curse of dimensionality leads to data sparsity, making it difficult to find enough neighbors within each window. In such cases, ALE may produce inadequate or unstable results.
Practical Considerations
When applying ALE, practitioners should carefully choose the number of windows, often based on the data density and the desired granularity. Cross-validation or sensitivity analysis can help assess the stability of the ALE curves. Additionally, ALE is model-agnostic, meaning it can be applied to any machine learning model, including deep learning networks, neural networks, and ensemble methods. However, for very complex models with high-dimensional inputs, the computational cost of evaluating the model many times can be significant, especially if the model is large.
Comparison with Other Interpretability Methods
ALE is part of a broader toolkit for model interpretation. Partial dependence plots are simpler but assume independence. Marginal plots use conditional distributions but average predictions, which can be biased. Shapley values provide a game-theoretic approach to feature attribution, but they can be computationally expensive. ALE offers a balance between accuracy and efficiency, making it a popular choice for regression and classification tasks where feature correlations are present.
Applications in Industry
ALE has been adopted in various industries to validate and explain model behavior. In finance, it helps credit risk analysts understand how factors like income and debt-to-income ratio affect loan approval decisions. In healthcare, it can reveal how patient characteristics influence predicted outcomes, aiding in clinical decision support. In marketing, ALE plots help identify how customer attributes drive purchase likelihood, enabling targeted campaigns. Because ALE provides a global view of feature effects, it complements local explanation methods like LIME or SHAP, which focus on individual predictions.
Software Implementations
Several open-source libraries implement ALE, including the alibi package for Python, which provides a comprehensive suite of explainability methods. The iml package in R also offers ALE plots. These tools allow practitioners to generate ALE curves with minimal coding, often requiring just the trained model and the training data. As the field of explainable AI grows, ALE remains a fundamental technique for understanding model behavior, especially in regulated industries where transparency is mandatory.
See Also
- Partial dependence plots
- Shapley values
- Local interpretable model-agnostic explanations
- Interpretability
References
- Munn, Michael (2022). Explainable AI for Practitioners. O'Reilly Media, Incorporated. ISBN 978-1-0981-1910-2.
- Apley, D. W., & Zhu, J. (2020). Visualizing the effects of predictor variables in black box supervised learning models. Journal of the Royal Statistical Society: Series B, 82(4), 1059-1086.