Data Pre-Processing

Data pre-processing is the preparation of raw inputs for an AI model, such as scaling numbers, filling gaps or parsing trial PDFs for evidence review.

Status
Published, version 1.0.0
Last reviewed
10 Nov 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

Data Pre-Processing for AI in Evidence Review and Economic Evaluation

Data pre-processing is the work done on raw inputs before an AI model sees them, so that the model receives numbers and text in a form it can use. In health economics the inputs might be patient-level costs and covariates drawn from real-world data, or trial reports held as PDF files that a language model will screen. Choices made at this stage change what a model learns and how well it appears to perform, yet they rarely show in the final output. NICE ECD20 (2026), the NICE framework on AI methods for evidence, treats pre-processing as part of the AI system, to be validated with the rest of the pipeline and described whenever AI-derived evidence is reported.

What counts as pre-processing in an AI workflow

In the ECD20 glossary the term covers any step that readies inputs before a model uses them, and that step may itself be done by AI. The examples given there include putting numbers on a common scale, tidying text and deciding what happens to missing values. Elsewhere in the framework the term covers documents as well. Before a full-text record can be screened it may first need turning into clean, structured text, with its tables and figures handled too.

Tabular pre-processing prepares a matrix of patients by variables for a statistical or machine learning model, as in a risk model built from an electronic health record. Document pre-processing prepares text for a large language model or a trained classifier, as in screening for a systematic review.

ECD20 notes that large language models can write code for data cleaning and analysis, with varying success. In primary research the framework accepts generative AI for such code only if a human expert verifies every output that could affect the analysis and results.

Centring and scaling numerical inputs

Many learning methods compare patients through distances or penalise coefficients by their size, so the units of measurement find their way into the answer. James and colleagues show this for a K-nearest neighbours classifier, where measuring age in minutes instead of years would give quite different classifications. They show it again for ridge regression, whose coefficient estimates can change substantially when a predictor is multiplied by a constant, while ordinary least squares estimates simply rescale and the fit is unchanged.

The usual remedy subtracts the mean of each variable and divides by its standard deviation.

zij=xij−xˉjsjz_{ij} = \frac{x_{ij} - \bar{x}_j}{s_j}

where zijz_{ij} is the standardised value of variable jj for patient ii, xijx_{ij} is the recorded value, xˉj\bar{x}_j is the mean of variable jj and sjs_j is its standard deviation, both computed on the data used to fit the transformation. Each standardised variable is a z-score with mean zero and standard deviation one in those data. James and colleagues note that software differs in using nn or n−1n - 1 as the divisor for sjs_j, where nn is the number of observations, and that the choice does not matter if every variable follows the same convention.

In health economic datasets annual costs in GBP run into thousands while age runs into tens, and utility values sit at or below 1, so without scaling a distance-based method would be steered almost entirely by cost.

Missing values as a modelling choice

Most algorithms will not run with gaps in the data, and the way the gaps are filled is an assumption about why they are missing. The mechanisms are treated under missing data and the methods under imputation, so a step labelled data preparation can carry a decision that changes a cost-effectiveness result.

Faria and colleagues, writing on cost-effectiveness analysis within randomised trials, summarise earlier work as concluding that removing people with missing data, or replacing each gap with one predicted value, is rarely adequate. They accept mean imputation for missing baseline covariates but judge it never appropriate for missing outcomes, because it underestimates uncertainty. They describe multiple imputation and likelihood-based models among the more appropriate methods, and ask for sensitivity analysis on the assumed missing data mechanism. An automated pipeline that silently drops incomplete rows, or fills missing outcomes with column means, makes the choices this guidance warns against, at a point where no reviewer may look.

Preparing trial reports for screening and extraction

For full-text screening, ECD20 observes that some AI tools accept PDFs and images directly, but that the accuracy of that processing varies and is hard to verify or audit. It adds that a deterministic PDF parser can help reproducibility and auditability, while warning that parsers are generally weaker on scientific documents and that their output must be validated, not treated as a complete and faithful copy of the source.

Even a cleaned report may exceed the amount of text a model can take in at once, the limit described under Context Window. The framework gives two mitigations. One splits the record into segments, converts them to vectors and retrieves only the chunks relevant to each eligibility criterion, which is retrieval-augmented generation and must itself be validated. The other assesses each chunk with AI and aggregates the evidence before a decision on the whole document, with particular care where eligibility depends on information spread across chunks.

For data extraction, ECD20 asks that parsing, chunking and the linking of several reports of one study keep the context and content the extraction needs, and that each step be documented. A results table split across two chunks, or a dose separated from its arm label, can produce a wrong extracted value even when the model reads each chunk correctly, and that value may then become an input to a health economic model.

Keeping test data out of pre-processing

A mean used for scaling, or a model used to impute, is itself estimated from data. If it is estimated on records later used to test the model, information passes from the test set into training. Kapoor and Narayanan define data leakage as a spurious relationship between the predictors and the target that arises from data collection, sampling or pre-processing, and note that it usually inflates estimates of performance.

One category in their taxonomy is pre-processing on the training and test sets together, with imputation as an example. Their survey found leakage reported in 294 papers across 17 fields. In their re-analysis of civil war prediction studies, one of which had imputed the training and test data together and two of which had reused an imputed dataset incorrectly, complex machine learning models no longer performed substantively better than logistic regression once the errors were corrected.

ECD20 sets the same rule in its principles, requiring independent datasets for model selection, training, optimisation, customisation and validation. The scaler and the imputation model are therefore fitted on the training data and applied unchanged to validation and test records, and within cross-validation the fitting is repeated inside each training fold. Without that separation the test set no longer stands in for unseen patients, so the model scores better on it than it will on new patients and any overfitting can go undetected.

Worked example with age and annual cost

All numbers in this example are illustrative. A team builds a nearest neighbours model that matches each new patient to the most similar training patients by age and annual cost. The training set holds four patients, aged 55, 55, 75 and 75, with annual costs of GBP 2,000, GBP 4,000, GBP 2,000 and GBP 4,000. Standard deviations use divisor nn.

1. Fit the scaler on the training data. Mean age is (55 + 55 + 75 + 75) / 4 = 65, and each age is 10 years from it, so the variance is 400 / 4 = 100 and the standard deviation is 10. Mean cost is 12,000 / 4 = 3,000, and each cost is 1,000 from it, so the standard deviation is GBP 1,000.

2. Compare two new patients in raw units. Patient A is 60 with a cost of GBP 2,500, and patient B is 70 with a cost of GBP 2,600. The age gap is 10 and the cost gap is 100, so the distance is the square root of (100 + 10,000) = the square root of 10,100 = 100.50. Cost supplies 10,000 / 10,100 = 0.990, or 99.0%, of the squared distance.

3. Compare them after scaling. Patient A sits 5 years and GBP 500 below the training means, so A becomes -5 / 10 = -0.5 for age and -500 / 1,000 = -0.5 for cost. Patient B sits 5 years above and GBP 400 below, so B becomes 5 / 10 = 0.5 for age and -400 / 1,000 = -0.4 for cost. The gaps are 1.0 and 0.1, so the distance is the square root of (1.00 + 0.01) = the square root of 1.01 = 1.005, and cost now supplies 0.01 / 1.01 = 0.010, or 1.0%, of it.

4. Fit the scaler wrongly on all six patients. The ages become 55, 55, 75, 75, 60 and 70, with mean 390 / 6 = 65. The squared deviations are 100, 100, 100, 100, 25 and 25, summing to 450, so the variance is 450 / 6 = 75 and the standard deviation is 8.660. Patient A's standardised age becomes -5 / 8.660 = -0.577 instead of -0.5.

5. Interpretation. In raw units a GBP 100 cost gap outweighs a ten-year age gap, purely because of the units. After scaling, the age gap of one training standard deviation counts far more than a cost gap of a tenth of one, which makes the weighting a visible choice. Step 4 shows leakage on a small scale, because the test patients have shaped their own standardised values.

Documenting and validating the pipeline

The ECD20 principles call for pre-processing to be documented so that each use of AI can be traced, ask for source code for pre- and post-processing where possible, and name pre- and post-processing among the factors that can affect reproducibility. Validation is expected to cover the whole end-to-end pipeline, parsers and any retrieval component included.

For full-text screening, reports should describe the data format of the records given to the AI tool and how the preparation steps were built, checked and kept under review for as long as the tool is in use. In health economic evaluation, ECD20 allows AI only as support with a human closely involved, for example code that a person then verifies and runs.

Boundaries and common misreadings

Pre-processing acts on inputs and post-processing on outputs, and ECD20 names the two together in its validation and reporting expectations. Pre-processing comes before Model Training, and its fitted quantities, such as means, standard deviations and imputation models, behave as part of the trained model. Jurafsky and Martin describe how a language model's tokeniser first splits text by fixed rules in a pretokenisation stage and then into learned subword units such as byte-pair encoding tokens, covered under Token (AI), whereas stemming and similar text normalisation are steps an analyst chooses.

A common misreading treats pre-processing as neutral. Filling gaps with means, or dropping incomplete records, embeds a missing data assumption, and Faria and colleagues note that different methods can lead to different decisions on value for money. A second treats a parser's output as the document itself. ECD20 asks for parser output to be validated, and a table that fails to convert never reaches the model.

Sources

  • Faria R, Gomes M, Epstein D, White IR. A guide to handling missing data in cost-effectiveness analysis conducted within randomised controlled trials. PharmacoEconomics. 2014;32(12):1157-1170. https://doi.org/10.1007/s40273-014-0193-3
  • James G, Witten D, Hastie T, Tibshirani R, Taylor J. An Introduction to Statistical Learning with Applications in Python. Cham: Springer; 2023. Chapters 4 and 6. https://www.statlearning.com
  • Jurafsky D, Martin JH. Speech and Language Processing. 3rd ed. draft, 19 August 2026. Chapter 2, Words and Tokens. https://web.stanford.edu/~jurafsky/slp3/
  • Kapoor S, Narayanan A. Leakage and the reproducibility crisis in machine-learning-based science. Patterns. 2023;4(9):100804. https://doi.org/10.1016/j.patter.2023.100804
  • National Institute for Health and Care Excellence. AI methods for evidence framework (ECD20). NICE; published 9 November 2026. Chapters on principles for using AI in evidence activities, AI methods for primary evidence generation, AI methods for evidence synthesis and AI methods for health economic evaluation, and Appendix A glossary. https://www.nice.org.uk/corporate/ecd20

Library

Publications

2
  • Journal article

    MSR117 Large Language Models for Data Extraction in a Systematic Review: A Case Study — Edwards M, Ferrante di Ruffano L, Vol. 27, No. 12, p. S461 ed., 2024 (Value in Health)

    Case study of LLM data extraction in a systematic review, published as a poster abstract.

  • Journal article

    Use of Large Language Models to Extract Cost-Effectiveness Analysis Data: A Case Study — Gu X, Zhang H, Patil D, et al, Vol. 28, No. 11, pp. 1637-1645 ed., 2025 (Value in Health)

    Measures how accurately a custom GPT pulls cost-effectiveness data from published studies compared with manual extraction.

Frequently Asked Questions (6)

  • What is Data Pre-Processing?

    Data pre-processing is the preparation of raw inputs for an AI model, such as scaling numbers, filling gaps or parsing trial PDFs for evidence review.

    Source: NICE ECD20 (2026)

  • Why does data pre-processing rescale numerical inputs before a machine learning model is fitted?

    Many learning methods compare patients by distance or penalise coefficients by their size, so the units in which a variable is recorded can change the result. James and colleagues show that measuring age in minutes instead of years would give quite different classifications from a K-nearest neighbours classifier, and that ridge regression estimates can change substantially when a predictor is multiplied by a constant. The usual step subtracts the mean of each variable and divides by its standard deviation, giving values with mean zero and standard deviation one. In health economic data annual costs run into thousands while ages run into tens, so without scaling a distance-based method would be steered almost entirely by cost.

    Source: James et al. 2023

  • How can the handling of missing values during data pre-processing change a cost-effectiveness result?

    Most algorithms will not run with gaps in the data, so a pipeline has to drop or fill them, and either choice is an assumption about why the data are missing. Faria and colleagues summarise earlier work as finding that removing people with missing data, or replacing each gap with one predicted value, is rarely adequate in cost-effectiveness analysis alongside randomised trials. They accept mean imputation for missing baseline covariates but judge it never appropriate for missing outcomes, because it underestimates uncertainty. Their guide notes that different methods can lead to different decisions on value for money, and it asks for sensitivity analysis on the assumed missing data mechanism.

    Source: Faria et al. 2014

  • What does NICE ECD20 expect when data pre-processing prepares trial reports for AI screening or data extraction in a systematic review?

    NICE ECD20 (2026) observes that some AI tools accept PDFs and images directly, but the accuracy of that processing varies and is hard to verify or audit. A deterministic PDF parser can help reproducibility, yet parsers are generally weaker on scientific documents, so their output must be validated and not treated as a complete and faithful copy of the source. For data extraction, the framework asks that parsing, chunking and the linking of several reports of one study keep the context and content the extraction needs, and that each step be documented. Reports of full-text screening should also describe the format in which the records were given to the AI tool.

    Source: NICE ECD20 (2026)

  • How can data pre-processing cause data leakage when the performance of a prediction model is tested?

    Quantities used in pre-processing, such as the mean for scaling or a model for imputation, are themselves estimated from data. Kapoor and Narayanan define data leakage as a spurious relationship between the predictors and the target that arises from data collection, sampling or pre-processing, and they note that it usually inflates estimates of performance. Pre-processing the training and test sets together, for example imputing across both, is one category in their taxonomy, and their survey found leakage reported in 294 papers across 17 fields. The safeguard is to fit the scaler and the imputation model on the training data only, apply them unchanged to test records and repeat the fit inside each cross-validation fold.

    Source: Kapoor & Narayanan 2023

  • How should data pre-processing be documented and validated when AI supports health economic evaluation or HTA?

    NICE ECD20 (2026) asks for pre-processing to be documented well enough for each use of AI to be traced, and for the source code used in pre- and post-processing to be included where possible. It names pre- and post-processing among the factors that affect reproducibility, and it expects validation to cover the whole end-to-end pipeline, parsers and retrieval components included. In health economic evaluation the framework allows AI only as support with a human closely involved, for example code that a person verifies and then runs.

    Source: NICE ECD20 (2026)

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 10 Nov 2026

Content version: 1.0.0

Canonical Identity

Term code
HS-HP-DH-098

Stable URI · Machine-readable · Resolvable · CC BY 4.0

This article is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/data-pre-processing