Practise vocabulary for explaining ML model predictions: SHAP, LIME, feature importance, fairness, and explainability in production contexts.
0 / 18 completed
1 / 18
___ is a model-agnostic technique that explains any classifier's prediction by approximating it locally with a simpler, interpretable model.
LIME (Local Interpretable Model-agnostic Explanations) perturbs the input and fits a simple linear model locally around the prediction, producing human-readable explanations. It works for any model type.
2 / 18
SHAP (SHapley Additive exPlanations) assigns each feature an ___ value representing its contribution to the prediction compared to the baseline.
SHAP Shapley values from game theory fairly attribute the prediction output among all features. Positive SHAP values push the prediction higher than baseline; negative values push it lower.
3 / 18
A ___ importance score ranks model features by how much they contribute to the model's predictions globally across all training examples.
Feature importance (e.g., from random forest, gradient boosting) ranks inputs by their aggregate contribution. It's a global explanation — it describes the model overall, not individual predictions.
4 / 18
In production ML systems, ___ explanations are generated at inference time for each individual prediction, enabling per-request transparency.
Local (per-prediction) explanations explain why the model made a specific prediction for a specific input. These are critical in high-stakes domains (credit, healthcare) where users have a right to explanation.
5 / 18
A fairness audit evaluates whether a model's predictions show ___ across protected groups such as gender, race, or age.
Disparate impact occurs when a model's decisions disproportionately affect a protected group. Fairness audits measure metrics like demographic parity, equalised odds, and individual fairness to detect and mitigate bias.
6 / 18
Reviewer: 'This model's explanation is just a list of feature importances. It doesn't tell me *why* it flagged this particular transaction as fraudulent! I need something more granular.' Which approach would you suggest to the developer to improve the explainability?
The reviewer is rightly concerned about a lack of detail. Global importance scores only show the overall impact of features; they don't explain *how* those features influenced this specific prediction. LIME offers local explanations by creating slightly altered versions of the input and observing how the output changes – providing more context for this individual case. Shapley values offer a similar level of detail.
7 / 18
Team Lead (Sarah) in a Slack channel: 'We need to understand why our credit risk model is denying loans to applicants from certain zip codes. I've requested an explanation from the ML team – can anyone suggest what kind of metric they should prioritize?' Which metric would be most effective for Sarah's immediate needs?
Sarah's primary goal is to pinpoint the reason for disparate impact in loan approvals. While global importance scores offer a general overview, they won't reveal localized issues. SHAP values provide an individual feature attribution – demonstrating how each factor influenced *this specific applicant's* decision, which is crucial for identifying bias within particular zip codes. Partial dependence plots would be useful later but aren't the first step.
This API response indicates that SHAP values were used to generate the explanation. SHAP provides a fair and accurate attribution of feature importance based on game theory principles – it's a robust method for understanding how each feature contributed to the prediction.
9 / 18
During a standup meeting, John says: 'We're using model explainability to ensure our fraud detection system isn't unfairly discriminating against certain demographic groups. We need to check for disparate impact.' What does 'disparate impact' refer to in this context?
'Disparate impact' in ML fairness refers to a situation where a model's prediction or outcome has an adverse effect on a protected group (e.g., racial minority) disproportionately more than others, even if there isn't any intentional bias built into the algorithm.
10 / 18
A developer is evaluating a model for loan applications and discovers that explanations consistently show high importance scores for 'age' and 'location'. This raises concerns about potential bias. Which of the following actions would be MOST appropriate to investigate?
While simply removing features isn't a solution (it could mask underlying issues), a formal fairness audit is crucial. These audits use statistical measures to determine if the model's predictions are unfairly skewed against certain groups, allowing you to identify and address genuine bias.
11 / 18
Reviewer: 'The model explanation output is just a list of feature importances. It's technically correct, but it doesn't provide any actionable insights for debugging the fraud detection logic. I need to understand which specific data points are driving the negative prediction for this user's transaction. What would be a more effective comment to add to the code here? // Model explanation: Feature importances
The reviewer correctly identifies that simply listing feature importances isn't helpful. Option A is too technical and doesn't address the need for debugging. Option C would be a good starting point to gather more data. Option B is a bad practice as it hides potential issues and option D is insufficient – the current output lacks detail.
12 / 18
Team Lead (David) in a Slack channel: 'We've deployed the new model for predicting customer churn. Initial explanations show 'tenure' and 'usage_frequency' are consistently top contributors to negative predictions. However, we're seeing a high false positive rate amongst users with short tenures. What immediate action should I suggest requesting from the data science team? // Requesting explanation
While a full audit is valuable, it's a long-term process. Option C directly addresses the observed problem – the high false positive rate related to short tenures. It focuses on understanding *why* those users are being flagged incorrectly. Option A and B are too broad, and option D may not provide immediate clarity.
13 / 18
API Response: { 'model_explanation': {'methodology': 'LIME', 'feature_importances': [{'feature': 'transaction_amount', 'value': 0.78}, {'feature': 'time_of_day', 'value': 0.15}, {'feature': 'merchant_category', 'value': 0.02}], 'confidence_interval': [0.73, 0.83] }}. A developer needs to explain this response to a non-technical stakeholder. Which phrasing best communicates the model's explanation? // Explaining API Response
Option 0 provides the clearest and most accessible explanation for a non-technical stakeholder. It highlights the key features and quantifies the certainty level in a way that's easy to understand. Options B and C are too technical or misleading, and option D is unhelpful.
14 / 18
During a standup meeting, Maria says: 'We're using Shap values to understand why our loan application model is rejecting applications from applicants in rural areas. We're seeing that 'distance_to_nearest_branch' and 'credit_history_length' are driving the negative predictions. However, this doesn't tell us if those factors *should* be influencing the decision—perhaps there's a proxy variable we haven't considered.' What should Maria suggest to move forward? // Moving Forward
Option 1 is crucial – Maria correctly recognizes that feature importance doesn't automatically imply fairness or validity. Requesting a deeper dive into the data allows them to investigate potential proxy variables and understand whether these factors are truly relevant to loan risk. The other options would be premature steps without understanding the underlying problem.
15 / 18
You're writing a PR description for adding model explainability to a fraud detection system. Which sentence best describes the goal of using explanations in this context?
```text
'This change improves model transparency and allows us to identify potential biases within the prediction process.'
```
Correct – The key benefit of model explainability in fraud detection is uncovering bias and understanding why decisions are being made. Accuracy improvements aren't the primary goal; transparency and fairness are. The other options describe different aspects of ML deployment or compliance, not the core purpose of explanation.
16 / 18
During a code review of a fraud detection model, a reviewer comments: 'This explanation only shows the feature importance scores. It doesn't explain *how* those features influenced the prediction for this specific transaction.' What is the primary concern being raised?
This question tests understanding of the limitations of feature importance alone. The reviewer isn't questioning SHAP itself, but rather that the explanation doesn't provide context for this *specific* transaction. Simply knowing a feature is important globally doesn't explain why it mattered in this case – crucial for debugging or identifying potential bias.
17 / 18
Sarah, the team lead, sends a Slack message: 'I need to see the SHAP values for our loan application model's predictions. Specifically, I want to understand which features contributed most to denying an applicant's loan.' What does Sarah primarily want to achieve by requesting this information?
This question assesses understanding of SHAP's use for bias detection. Sarah is seeking granular explanations to uncover discriminatory patterns in the model's predictions – a core application of SHAP values in fairness auditing. The other options represent different goals related to model optimization or communication, not the primary purpose of SHAP.
18 / 18
An API response is received for a credit risk model: `{'model_explanation': {'methodology': 'LIME', 'feature_importances': [{'feature': 'credit_score', 'value': 0.72}, {'feature': 'income', 'value': 0.18}, {'feature': 'debt_to_income_ratio', 'value': 0.03}], 'confidence_interval': [0.65, 0.78]}}`. A developer is reviewing this response and notes that 'credit_score' has the highest importance. What does this suggest?
This question tests understanding of LIME explanations and confidence intervals. The highest importance value combined with a confidence interval indicates that this specific estimate is plausible within a range of possible values – it's not a hard-and-fast rule. The developer needs to consider the broader context before drawing conclusions about the model's behavior.
What will I practise in "Model Explainability Language"?
This module focuses on ML Model Serving — real workplace phrasing you'll use on the job. It contains 18 scenario-based multiple-choice questions with instant feedback.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account or sign-up required.
How many questions does this exercise have?
This module includes 18 questions. Each one gives an immediate right/wrong result plus a full explanation of the correct phrasing.
What happens if I answer a question incorrectly?
You'll see the correct answer highlighted straight away, along with a plain-English explanation of why it's right and why the other options don't fit — mistakes are part of the learning here.
Can I retry the exercise if I want a better score?
Yes — use the 'Try again' button on the results screen to reset your score and go through the questions again. There's no limit on attempts.
Who is this ML Model Serving exercise for?
It's aimed at IT professionals with working English who want to sound more natural and precise around ml model serving — useful whether you're preparing for real conversations at work or just building confidence with the vocabulary.
Do I need an account to track my progress?
No account is needed. Your progress through the exercise is tracked locally in your browser for the current session, and you can replay the module at any time.
How is this different from reading a blog article?
This exercise is an interactive drill that tests and reinforces specific phrasing through multiple-choice questions with instant feedback, while blog articles explain concepts and vocabulary in prose. The two work well together.
Where can I find more ML Model Serving exercises?
See the ML Model Serving hub for more modules like this one, or browse the full Exercises page for other IT-English topics.
Can I complete this exercise on my phone?
Yes — every exercise on CoderSlingo is fully responsive and works on phones and tablets, so you can practise anywhere.