AI Glossary / Governance, ethics and safety / Intermediate
Pre-processing algorithm
Definition
A pre-processing algorithm is a defined procedure that prepares or transforms data before a model uses it. In fairness work, such algorithms change training examples, their weights or their representation to address specified sources or measures of unfairness before model fitting.
What it means
The broader category includes routine preparation such as scaling numbers and encoding categories. In the governance context, the focus is on deliberate interventions intended to influence the relationships a model learns. The intervention acts on the data supplied to learning rather than only adjusting the model's final decisions.
Different algorithms change different things. Reweighting gives some training examples more influence without necessarily changing their recorded values. A representation transformation changes the features the model receives. Other approaches may modify labels or sampling, which requires careful justification because it changes what the dataset expresses.
Pre-processing is not synonymous with removing sensitive columns. Other features may retain information related to those attributes. Nor does a transformed dataset certify a fair system: model choice, objectives, deployment conditions and the definition of fairness all remain relevant.
How it works
First identify the problem the intervention is intended to address and the fairness criterion or mechanism involved. Inspect data quality and collection before selecting an algorithm; a transformation may be an inappropriate substitute for obtaining missing information or correcting a poor target definition.
Fit any learned transformation on the appropriate training data and keep final evaluation independent. For reweighting, calculate the weights and ensure the learning algorithm actually uses them. For a feature transformation, preserve the fitted procedure so that later inputs receive the corresponding treatment. Requirements for group attributes vary by method and stage.
Evaluate the resulting model and the full workflow, not just a statistic in the transformed dataset. Check relevant error rates, usefulness, uncertainty and unintended effects. Removing linear correlation, for example, does not establish that every nonlinear relationship or proxy has disappeared. Document assumptions and monitor whether the transformation remains suitable as the population and data collection process change.
Three practical examples
- A research team reweights group-and-label combinations before fitting a classifier, then tests the resulting decisions on separate data.
- An analyst evaluates a representation transformation intended to reduce specified correlations with sensitive attributes while preserving useful information.
- A product team compares a mitigation algorithm with collecting additional examples from an underrepresented setting, rather than assuming transformation is the only option.
Think of it this way
Think of preparing ingredients before cooking. Changing the mixture or the amount of each ingredient affects what the recipe can produce, but it does not determine every property of the finished meal.
The analogy is limited because data represent people, events and measurement choices. Altering those representations requires a substantive justification, not merely a convenient way to obtain a preferred score.
Worked example
What reweighting changes
Consider an invented dataset of 100 examples. Group A has 40 positive and 10 negative labels; Group B has 10 positive and 40 negative labels. Each group therefore contains 50 examples, and the dataset has 50 positives and 50 negatives overall.
For a simple illustrative reweighting target that gives each group-label combination total weight 25, assign weight 25/40 = 0.625 to A-positive and B-negative examples. Assign weight 25/10 = 2.5 to A-negative and B-positive examples.
Each cell then contributes total weight 25, while the original 100 records and their labels remain present. This changes their influence on a compatible learner. It does not prove that the labels are appropriate or that the learned model's future decisions will meet a fairness requirement. That result must be evaluated separately.
Illustrative case study
Fictional case: Rowan Training applies a reweighting method to an assessment dataset. The preprocessing report shows the expected weighted proportions, but a review finds that the chosen training routine ignores the supplied sample weights.
The team checks the connection between the transformation and model fitting, then evaluates the corrected pipeline on independent data. It also reviews the assessment labels rather than assuming that changing weights resolves every concern in the dataset.
The case demonstrates that a mathematically correct data adjustment can have no intended effect if the downstream process does not use it. It reports no real deployment or measured mitigation success.
Common misconceptions and mistakes
- Pre-processing guarantees fair predictions. A data-level adjustment requires evaluation of the resulting model and context.
- Removing a sensitive attribute removes all related information. Correlated features or combinations can remain informative.
- A transformed dataset can be evaluated only after transformation. Preserve appropriate original information and provenance to understand what changed and why.
Business use
Businesses should request the intervention's purpose, assumptions and specific effect on data. Ask whether it changes values, weights, labels or sampling, and how those changes are used by the learning process. Keep a reproducible record of the original data lineage and the authorized transformations.
Compare alternatives and assess tradeoffs in the actual use case. An algorithm that improves one aggregate measure may worsen another or obscure errors in data collection. Involve relevant expertise when deciding whether the chosen adjustment is appropriate, and maintain suitable controls around sensitive attributes used for analysis.
People also ask
Is ordinary scaling a fairness algorithm?
Scaling is preprocessing, but it is not automatically a fairness intervention.
Does reweighting duplicate records?
It can be implemented by changing training weights without physically duplicating records; implementation details vary.
Must sensitive attributes be available during prediction?
That depends on the method. Distinguish attributes needed to fit, transform, evaluate and deploy the pipeline.
Check your understanding
A dataset has the intended weighted proportions, but the classifier ignores sample weights. Can the team claim the reweighting influenced training?
Answer: No. The downstream learner must actually use the weights, and the resulting decisions still need independent evaluation.
Related terms
- Representation learning
- Preprocessing
- In-processing
- Post-processing algorithm
- Reweighting
- proxy attribute
Learn next
Read reweighting and data leakage. For one proposed preprocessing step, identify what is fitted, which data it uses and how the deployed pipeline applies the fitted result.
More in Governance, ethics and safety
- Post-hoc explanation - A post-hoc explanation is an explanation produced by analyzing an already developed AI model or its behavior.
- Post-processing - Post-processing is the adjustment or transformation of a model's output after inference.
- Practical significance - Practical significance is the importance of an observed or estimated effect in its real-world context.
- Prediction bias - Prediction bias is the difference between the average of a model's predictions and the average of the corresponding observed labels in a dataset.
- Predictive parity - Predictive parity is a group fairness criterion requiring equal precision, also called positive predictive value, across the groups being compared.
- Preference alignment - Preference alignment is the process of adjusting an AI system's behavior to better match specified preferences about its outputs or actions.
Sources
AI Fairness 360, Reweighing: https://aif360.readthedocs.io/en/stable/modules/generated/aif360.algorithms.preprocessing.Reweighing.html. Fairlearn, Preprocessing: https://fairlearn.org/main/user_guide/mitigation/preprocessing.html. Relevant returned documentation describes group-label weighting and correlation-removal transformations. The worked example is an original simplified calculation; it is not a guarantee of downstream fairness or a recommendation for a particular application.
Previous: Pragmatics Next: Pre-trained model