Skip to main content
Graphic showing a synthetic dataset of 1,000 customers analyzed for gender and income bias in AI decision-making, highlightin

Editorial illustration for Synthetic 1,000‑Customer Dataset Uses Gender and Income to Test Bias

Synthetic 1,000‑Customer Dataset Uses Gender and Income...

Updated: 4 min read

Bias doesn’t sneak into machine learning models, it’s baked in from the start. Here, we take a different approach: instead of chasing phantom fairness in a black-box algorithm, we build the bias ourselves. A synthetic thousand-customer bank dataset, stripped down to just gender and income, and a labeling rule that punishes women unless their pay stuns.

The result is a decision tree that learns to approve men reflexively and only grants women access when their earnings scream exception. We’ll train that tree, then turn to Mimesis to generate balanced test subjects and audit exactly how deep the discrimination runs. No hand-waving.

The data is the evidence, and the bias is laid bare.

In this example, we will synthetically generate a dataset of 1,000 bank customers, with just two features: gender and income. The data creation will be intentionally manipulated so that the gender attribute unfairly influences the binary outcome: loan approval. Specifically, for labeling the dataset, we will consider a scenario in which men are generally approved, whereas women are only approved when they have remarkably high income.

Training a Decision Tree classifier model = DecisionTreeClassifier(max_depth=3) model.fit(train_df[['Gender_Code', 'Income']], train_df['Approved']) The next step shows Mimesis in action. We will use this library to generate a small set of test subjects using the Generic class.

Bias is not born from data alone, it is authored, line by line, by the choices we make before a single model is trained. This synthetic 1,000‑customer dataset lays that truth bare. By scripting gender into the approval rules, we see how a decision tree, innocent of intent, faithfully mirrors the prejudice we coded.

The real test, however, comes after: when Mimesis helps us build balanced test subjects, we audit not the algorithm but ourselves. A fair model demands more than clean code; it demands datasets that challenge our assumptions rather than reinforce them. This exercise is a mirror.

Look closely. The bias you find is the bias you put there, and the bias you can now choose to remove.

Common Questions Answered

How does the synthetic 1,000-customer bank dataset demonstrate bias in machine learning models?

The dataset uses a labeling rule that systematically disadvantages women by requiring them to have significantly higher income than men to receive approval, while men are approved reflexively. This deliberately constructed bias shows how a decision tree model will faithfully learn and replicate the prejudicial patterns embedded in the training data, even though the model itself has no inherent bias.

What is the labeling rule used in this synthetic dataset to test gender bias?

The labeling rule punishes women applicants unless their pay is exceptionally high, creating an approval threshold that is much stricter for women than for men. This rule ensures that the resulting decision tree learns to approve male applicants reflexively while only granting women access when their earnings meet an extremely high exception standard.

Why does the article argue that bias is 'authored' rather than accidentally introduced into machine learning models?

The article contends that bias is not born from data alone but from the deliberate choices made before model training begins, such as how data is labeled and which features are prioritized. By demonstrating how scripted gender discrimination in the labeling rules produces a biased model, it shows that bias is authored line by line through human decision-making, not an inevitable outcome of the algorithm itself.

What does the article suggest is necessary for achieving fairness in machine learning models beyond clean code?

The article argues that a fair model demands more than clean code; it requires auditing and examining the human choices and assumptions made before training, not just the algorithm itself. By using Mimesis to build balanced test subjects, the focus shifts from trying to fix bias in the black-box algorithm to examining and correcting the biased choices we make during data preparation and labeling.

LIVE03:21OpenAI's Miles Wang in Talks for USD 2B AI Drug Discovery Startup