interpretability is the degree to which machine learning algorithms can be understood by humans. more specifically, interpretability describes the ability to understand the reasoning behind predictions and decisions made by a machine learning model.
how interpretability works
interpretability techniques help to reveal how machine learning models make predictions. by uncovering how various features contribute (or do not contribute) to predictions, interpretability techniques can help you validate that a machine learning model is using appropriate evidence for predictions and find biases in your model that were not apparent during training. some machine learning models, such as linear regression, decision trees, and generative additive models are inherently interpretable. however, interpretability often comes at the expense of power and accuracy, as illustrated in figure 1.
interpretability versus explainability
is an emerging field where the closely related terms interpretability and explainability are often used interchangeably. however, interpretability and explainability are different. explainability refers to explaining the behavior of a machine learning model in human terms, without necessarily understanding the model’s inner mechanisms. explainability can also be viewed as model-agnostic interpretability.
for engineers, one approach to explain the behavior of a system is by using first principles. a first-principles model has clear, explainable physical meaning, and its behavior can be parameterized. that type of model is known as “white box.” the behavior of machine learning models is more “opaque.”
machine learning models vary in complexity, intuitiveness of knowledge representation, and, thus, difficulty to fully understand how they work. machine learning models can be “gray box,” in which case you can apply interpretability techniques to understand their inner mechanisms, or “black box,” in which case you can apply explainability (or model-agnostic interpretability) techniques to understand their behavior. deep learning models are typically black box.
global and local interpretability methods
interpretability is typically applied at two levels:
- global methods: these interpretability methods provide an overview of the most influential variables in the model based on input data and predicted output.
- local methods: these interpretability methods provide an explanation of a single prediction result.
figure 3 illustrates the difference between the local and global scope of interpretability. you can also apply interpretability to groups within your data and arrive at conclusions at the group level, such as why a group of manufactured products were classified as faulty.
get started with interpretability examples in matlab
popular techniques for local interpretability include local interpretable model-agnostic explanations (lime) and shapley values. for global interpretability, many users start with feature ranking (or importance) and visualizing partial dependence plots. you can apply these techniques using matlab®, as shown in these examples:
why interpretability matters
engineers and scientists seek model interpretability for three main reasons:
- debugging: understanding where or why predictions go wrong. running “what-if” scenarios can improve model robustness and eliminate bias.
- guidelines: black-box or gray-box models may violate industry best practices.
- regulations: some government regulations require interpretability for sensitive applications, such as finance, public health, and transportation.
model interpretability addresses these concerns and increases trust in the models in situations where explanations for predictions are important, such as when comparing results between competing models, or necessary, such as when interpretability is required by regulation.
applications where interpretability matters
interpretability tools help you understand why a machine learning model makes the predictions that it does. interpretability is likely to become increasingly relevant as regulatory and professional bodies continue to work toward a framework for certifying ai for sensitive applications, such as:
interpretability with matlab
using matlab with statistics and machine learning toolbox™ enables you to you apply techniques to interpret machine learning models. here, some popular interpretability techniques are described.
local interpretable model-agnostic explanations (lime): use lime to approximate a complex model in the neighborhood of the prediction of interest with a simple interpretable model, such as a linear model or decision tree. you can then use the simpler model as a surrogate to explain how the original (complex) model works. figure 4 illustrates the three main steps of applying lime.
partial dependence (pdp) and individual conditional expectation (ice) plots: with these methods, you examine the effect of one or two predictors on the overall prediction by averaging the output of the model over all the possible feature values. figure 5 shows a partial dependence plot that was generated with the plotpartialdependence
function.
strictly speaking, a partial dependence plot shows that certain ranges in the value of a predictor are associated with specific likelihoods for prediction; that’s not sufficient to establish a causal relationship between predictor values and prediction. however, if a local interpretability method like lime indicates the predictor significantly influenced the prediction (in an area of interest), you can arrive at an explanation why a model behaved a certain way in that local area.
shapley values: this technique explains how much each predictor contributes to a prediction by calculating the deviation of a prediction of interest from the average. this method is particularly popular within the finance industry because it is derived from game theory as its theoretical underpinning, and because it satisfies the regulatory requirement of providing complete explanations: the sum of the shapley values for all features corresponds to the total deviation of the prediction from the average. the shapley
function computes shapley values for a query point of interest.
evaluating all combinations of features generally takes a long time. therefore, shapley values are often approximated by applying monte carlo simulation in practice.
figure 6 shows that in the context of predicting heart arrhythmia near the sample of interest, mfcc4 had a strong positive impact on predicting “abnormal,” while mfcc11 and 5 leaned against that prediction, i.e., toward a “normal” heart.
predictor importance estimations by permutation: matlab also supports permuted predictor importance for random forests. this approach takes the impact changes in predictor values have on model prediction error as an indication of predictor importance. the function shuffles the values of a predictor on test or training data and observes the magnitude of the resulting changes in error.
choosing a method for interpretability
different interpretability methods have their own limitations and strengths; take these into account when you seek interpretability in your application. figure 6 provides an overview of interpretability methods and guidance on how to apply them. the interpretability methods presented in figure 7 are available in matlab.
learn more
- overview of interpretability in matlab - documentation
- applying visualization and interpretability to deep neural networks - documentation
- model interpretability in matlab (5:49) - video
- - video
- machine learning tutorials and examples with matlab - overview
- - blog
related topics
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 mathworks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- (español)
- (english)
- (english)
欧洲
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
亚太
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)