Course contentsShow
← Machine Learning and Deep Learning
Lesson 3308 of 3,53872. Bias and FairnessFree lesson

Fairness-Aware Feature Engineering

Remove or transform features that encode protected attributes or serve as proxies for sensitive information.

Fairness-Aware Feature Engineering

What you'll learn: How to preprocess and transform features to reduce encoded bias before training your model.

The Core Idea

Even if you remove protected attributes like race or gender from your dataset, your model can still learn biased patterns through proxy features—variables that strongly correlate with sensitive information. Fairness-aware feature engineering means identifying and handling these problematic features before they reach your model.

Think of it like this: if you're trying to make hiring decisions fairly without considering zip code, but zip code strongly correlates with race due to historical segregation, your model can still learn racial bias indirectly. Fairness-aware engineering addresses this.

Key Techniques

Remove Direct Encodings

Drop features that directly encode protected attributes (e.g., fields like "gender" or "ethnicity") when they shouldn't influence decisions.

Identify and Transform Proxies

Look for features that serve as stand-ins for sensitive information:

  • Zip codes may proxy for race or socioeconomic status
  • First names may reveal gender or ethnicity
  • Years of experience may correlate with age

You can transform these by:

  • Aggregating to broader categories (individual zip → region)
  • Removing them entirely if they're strong proxies
  • Creating residualized features that remove correlation with protected attributes

Create Fairness-Enhancing Features

Sometimes adding features helps: include variables that capture legitimate differences while reducing reliance on proxies (e.g., actual skills assessment rather than educational pedigree that correlates with wealth).

Key Takeaway: Fairness-aware feature engineering proactively removes or transforms features that encode protected attributes or act as proxies, preventing bias from entering your model through the back door before training even begins.