Bird
Raised Fist0

The Fairness Paradox

THEORYadvancedInterview freq: high
Choose your preparation mode6 modes available
🐛
The Fairness Paradox
Issue noticed after the latest model update two weeks ago

Loan approval model for a major bank, processing 500,000 applications per month

Symptom
Model accuracy is stable at 0.92, but recall for minority group applicants is 0
📡
Signals
metric
Overall model accuracy from monitoring dashboard
Stable at 0.92
metric
Recall for minority group applicants
Dropped to 0 after latest update
distribution
Distribution of predicted probabilities for minority group
Highly skewed towards 0
feature_importance
Feature importance for 'credit_score' feature
Increased from 0.15 to 0.35 after update
log
Model training logs
No errors, but new feature 'employment_status' added
🔬
Hypotheses
The model is overfitting to the majority group data
Recall for minority group applicantsDistribution of predicted probabilities
Verify: Check the distribution of training data across groups
df['group'].value_counts(normalize=True).plot(kind='bar')
The new feature 'employment_status' is causing bias
Feature importance for 'credit_score'Model training logs
Verify: Analyze correlation between 'employment_status' and target variable across groups
df.groupby('group')['employment_status'].mean().plot(kind='bar')
🎯
Root Cause
The new feature 'employment_status' introduced bias against minority groups

The feature was not properly evaluated for fairness impact before deployment

🔧
Fix Strategy
ImmediateRollback to the previous model version
Short-termRemove 'employment_status' feature and retrain the model
Long-termImplement fairness-aware training and evaluation processes
🐍
Python Fix
Python
df.drop(columns=['employment_status'], inplace=True)
# Retrain model
model.fit(X_train, y_train)
✗
Common Wrong Diagnoses
▼ Show
The model is simply overfitting
Why candidates think this: Overfitting is a common issue when performance metrics drop
Why wrong: Overfitting would affect all groups, not just minority recall
The data pipeline has a bug
Why candidates think this: Pipeline issues can cause unexpected model behavior
Why wrong: Logs show no errors, and the issue is specific to a feature
📊
Monitoring to Add
  • Monitor recall across different demographic groups
  • Track feature importance changes over time
  • Set alerts for significant drops in minority group performance metrics
📋
Process Change

Introduce a fairness evaluation step before deploying new features

🏗️
Architectural Change

Incorporate fairness constraints into the model training pipeline

💡
Key Insight
Fairness issues can arise from seemingly innocuous feature updates, highlighting the need for thorough bias evaluation.

Practice

(1/5)
1. In a dataset with missing values in a numerical feature, which imputation strategy is most appropriate when the data is normally distributed?
easy
A. Use median imputation
B. Use mode imputation
C. Use zero imputation
D. Use mean imputation

Solution

  1. Step 1: Identify the distribution of the data

    For normally distributed data, the mean is the best measure of central tendency.
  2. Step 2: Eliminate wrong options

    Median is better for skewed data, mode for categorical data, and zero imputation can distort the distribution.
  3. Final Answer:

    Option D -> Option D
  4. Quick Check:

    Mean for normal distribution [OK]
Hint: Mean for normal distribution [OK]
Common Mistakes:
2. In which scenario is supervised learning most appropriate?
easy
A. When you want to cluster similar data points without labels.
B. When you have labeled data and want to predict outcomes.
C. When you need to explore an environment to maximize rewards.
D. When you want to reduce dimensionality of data without labels.

Solution

  1. Step 1: Identify the scenario.

    Supervised learning is used when labeled data is available and the goal is to predict outcomes.
  2. Step 2: Eliminate wrong options.

    When you want to cluster similar data points without labels. describes unsupervised learning (clustering), When you need to explore an environment to maximize rewards. describes reinforcement learning (exploration and rewards), and When you want to reduce dimensionality of data without labels. describes unsupervised learning (dimensionality reduction).
  3. Final Answer:

    Option B -> Option B
  4. Quick Check:

    Labeled data -> Supervised learning [OK]
Hint: Labeled data -> Supervised learning [OK]
Common Mistakes:
3. When deciding between Platt Scaling and Isotonic Regression for calibrating a model, which scenario favors Isotonic Regression?
medium
A. When the dataset is small and monotonicity is assumed
B. When the model outputs are binary
C. When computational efficiency is critical
D. When the model is highly overfitting

Solution

  1. Step 1: Understand the strengths of Isotonic Regression.

    Isotonic Regression is non-parametric and assumes monotonicity, making it suitable for small datasets where this assumption holds.
  2. Step 2: Evaluate each scenario.

    Isotonic Regression is not ideal for overfitting (A) or binary outputs (B), and is less efficient than Platt Scaling (D).
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Isotonic = small data, monotonicity. [OK]
Hint: Isotonic = small data, monotonicity. [OK]
Common Mistakes:
4. An SVM model with a Gaussian kernel is not performing well on the test set. What is a likely cause?
medium
A. The model is overfitting due to a high regularization parameter
B. The model is underfitting due to a high regularization parameter
C. The model is underfitting due to a low regularization parameter
D. The model is overfitting due to a low regularization parameter

Solution

  1. Step 1: Analyze the effect of regularization on SVM

    A low regularization parameter allows more flexibility, leading to overfitting.
  2. Step 2: Eliminate wrong options

    The model is overfitting due to a high regularization parameter is incorrect because a high regularization parameter reduces overfitting. The model is underfitting due to a low regularization parameter is incorrect because a low regularization parameter does not cause underfitting. The model is underfitting due to a high regularization parameter is incorrect because a high regularization parameter causes underfitting, not overfitting.
  3. Final Answer:

    Option D -> Option D
  4. Quick Check:

    Low regularization can lead to overfitting [OK]
Hint: Low regularization can lead to overfitting [OK]
Common Mistakes:
5. When deciding between using a pretrained model or training from scratch for a specific task, which scenario favors training from scratch?
medium
A. The task involves a domain with no available pretrained models.
B. The task has a very large and diverse dataset available.
C. The task is similar to the one the pretrained model was trained on.
D. The task requires real-time inference with minimal latency.

Solution

  1. Step 1: Identify when pretraining is less beneficial.

    Pretraining is less useful when no relevant pretrained models exist.
  2. Step 2: Eliminate wrong options.

    The task is similar to the one the pretrained model was trained on. favors using pretrained models due to task similarity. The task has a very large and diverse dataset available. also favors pretrained models due to data availability. The task requires real-time inference with minimal latency. is unrelated to the choice between pretraining and training from scratch.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    No pretrained model? Train from scratch. [check]
Hint: No pretrained model? Train from scratch. [check]
Common Mistakes:
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard