Nutrition · Precision nutrition and emerging methods
Training, validation and prediction across groups
Evaluate a model on data that genuinely test its intended use, including error and performance across relevant groups.
Use the study-design and digital-measurement lessons, including clustered observations.
After reading, you can
- Distinguish development, internal evaluation and external validation.
- Identify leakage in repeated-meal datasets.
- Explain why ranking and calibration answer different questions.
Define what the model will predict for whom
A model needs a target outcome, prediction horizon, population and intended use. Predicting another meal in a well-measured participant differs from predicting a response in a new person or new setting.
The evaluation should represent that intended task. A model’s performance is a measured property under particular conditions, not a permanent stamp of validity.
Keep evaluation data outside development
Model development can include choosing features, handling missing values, tuning parameters and selecting among models. These choices can fit chance patterns as well as useful relationships.
Information from the evaluation set should not influence those development decisions. Otherwise the evaluation partly tests a model already adapted to its answers, a problem called leakage.
Internal evaluation methods help assess performance within the development setting. External validation examines a defined model in a relevant dataset beyond its development source. Both require appropriate design and uncertainty estimates.
Split data at the level of the intended question
If the goal is prediction for new people, randomly placing different meals from the same people in both training and testing can give an optimistic impression of that task. Person-specific information may be shared across the boundary.
If the goal is a future meal for an already observed person, that is a different task and can justify a different evaluation design. Time order still matters when future information would be unavailable at prediction time.
The important rule is to make the split match the intended use and apply preprocessing within the appropriate development data, rather than relying on a familiar random split by default.
Ranking, error and calibration differ
A model can rank people correctly while systematically overestimating or underestimating their values. Calibration concerns agreement between predictions and observed outcomes. Overall error measures answer another part of the performance question.
In an invented example, predictions are 10, 20, 30 and 40 arbitrary units; observations are 12, 22, 32 and 42. The ordering is perfect, but every prediction is 2 units too low. The mean absolute error is 2 units.
For risk predictions, overall agreement alone can hide errors at particular risk levels. Appropriate performance assessment examines the range relevant to the decision, not just one attractive summary.
| Invented prediction | Observed value | Observed minus predicted |
|---|---|---|
| 10 | 12 | +2 |
| 20 | 22 | +2 |
| 30 | 32 | +2 |
| 40 | 42 | +2 |
Examine relevant groups and uncertainty
Average performance can conceal differences across groups, settings and exposure ranges. Evaluation should examine relevant subgroups with adequate data and uncertainty, rather than assuming equal performance.
Small subgroup estimates can be unstable. Missing representation creates an evidence gap, while a subgroup label alone does not explain the biological or social cause of any difference.
Transparent reporting lets readers assess these limits. Prediction evaluation then informs, but does not replace, the next question: whether using the predictions improves decisions.
Worked example
Perfect order, biased values
For the invented four predictions, compute the mean absolute error and explain why correct ranking is insufficient.
Read the worked reasoning
Each absolute error is 2, so the mean absolute error is (2+2+2+2)÷4 = 2 units. The order is correct, but values are systematically underestimated, which can matter to decisions.
Try the reasoning
Think through each question before opening the answer.
What is leakage?
Show the answer and reasoning
Evaluation information influences model development or enters across a boundary in a way unavailable for the intended prediction task.
Why split by person when evaluating new-person prediction?
Show the answer and reasoning
Meals from the same person can share information; splitting them across sets can fail to test generalisation to new people.
Does good average performance prove equal performance in every group?
Show the answer and reasoning
No. Relevant group and setting performance must be evaluated with uncertainty.
What to carry forward
Evaluate the intended prediction task with protected data boundaries, appropriate performance measures and relevant population coverage.
References
Sources supporting the explanations and learning checks in this lesson.
- TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methodsGary Collins and TRIPOD collaboratorsResearch reporting guideline
- Evaluation of clinical prediction models (part 2): how to undertake an external validation studyBMJ Research Methods and ReportingPrimary methods guidance
- Human postprandial responses to food and potential for precision nutritionSarah E. Berry and international PREDICT1 collaboratorsResearch paper
- Key Concepts about ValidationNIH National Cancer InstituteResearch methods resource