Tutorials › Model-Informed Drug Development (MIDD) › Leave-One-Species-Out Validation

Translational Modeling and Uncertainty · Tutorial 136 of 596

Leave-One-Species-Out Validation

Use leave-one-species-out validation to assess how well a translational model predicts a species it was not fitted to.

Advanced 12 min read

What You'll Learn

  • Define the withheld species as the validation unit and prevent information leakage between folds.
  • Construct predictions using only the non-withheld species in each fold.
  • Calculate and interpret mean log prediction error, mean absolute error, and root mean squared error.
  • Summarize predictive-interval coverage across held-out species.
  • Recognize when small species counts, model choices, or species differences limit conclusions.

Why Withhold an Entire Species?

A translational model is useful only to the extent that it can predict beyond the data used to fit it. When the intended use is prediction in a species not used for fitting, validation should mimic that task: remove one animal species, refit the model using the others, and predict the removed species. Repeating this for each species reveals how predictions behave when a whole species is absent from model development.

The unit withheld matters. If a study contains many animals from each of a few species, randomly assigning individual animals to training and validation sets can leave animals from every species in both sets. Such a split mainly tests prediction for additional animals from represented species; it does not directly test prediction for an unrepresented species. Leave-one-species-out validation (LOSO) withholds all records from one species at once.

Definition: Suppose data are available for \(S\) animal species, with \(D_s\) denoting all data from species \(s\). In fold \(s\), fit the prespecified translational modeling procedure using \(\{D_j:j\ne s\}\), then predict the chosen outcome for \(D_s\). Repeat for \(s=1,\ldots,S\). The resulting \(S\) held-out predictions, or summaries of them, are the LOSO predictions.

The procedure evaluates a modeling workflow, not merely a final equation. Any choice that uses data—such as selecting covariates, choosing among candidate structures, estimating parameters, or tuning a prediction method—must be made using only the training species within each fold. Otherwise information from the withheld species has influenced its prediction, making validation optimistic. The model form and evaluation target should be stated before inspecting the held-out outcomes.

Set the Prediction Target and Assumptions

Specify what is predicted before creating folds. For a pharmacokinetic (PK) example, the target might be species-level log clearance at a defined dose and physiological condition. For pharmacodynamic (PD) translation, it might be a defined response parameter or response summary. The outcome, units, time point or summary, and data-processing rules must be comparable across species. A fold is not interpretable if one species' outcome is defined differently from another's.

LOSO validation relies on several substantive conditions. First, each species must have enough data to define the target and evaluate its prediction. Second, the held-out species must not contribute to fitting, preprocessing, model selection, or uncertainty estimation for that fold. Third, the species used for validation should represent the kind of species-level prediction to which the result will be applied. If the withheld species is biologically very different from all training species, the exercise may still expose a limitation, but it does not guarantee performance in other species or in humans. The earlier material on diagnosing extrapolation distance across species helps interpret how far a held-out species lies from the training domain.

Finally, validation must reflect the intended prediction. If predictions concern a new animal from a known species, uncertainty should be appropriate to that target. If the target is a species-level mean or parameter, uncertainty should reflect that different estimand. A prediction interval should be generated from the training fold alone and should include the relevant sources of uncertainty for that target. LOSO coverage is an empirical summary across these folds; it does not, by itself, establish that an interval is calibrated for future species.

Procedure: For each species in turn, hold out all its data, repeat the prespecified fitting and prediction procedure using only the other species, save the prediction and interval, and compare them with the held-out outcome. Summarize results across species, while retaining the fold-specific results so that a single average cannot conceal a serious failure in one species.

Worked Log-Scale Predictions

Log scales are often useful for positive PK quantities such as clearance because differences on the log scale correspond to ratios on the original scale. Define \(z=\ln(CL/(1\ \mathrm{L\,h^{-1}}))\), a dimensionless log clearance, and let \(x\) be a specified log body-mass predictor. Consider four hypothetical species with one species-level summary each. The values below are deliberately illustrative, not observations from a real study.

Species\(x\)Observed \(z\)
A01
B12
C22
D34

Worked Example: Predicting One Withheld Species

Use the linear model \(z=a+bx+\varepsilon\) as the prespecified procedure. Withhold species A, and fit the line to B, C, and D only. For these three training points, \(\bar{x}=2\), \(\bar{z}=8/3\), and the least-squares slope is

$$ \hat b=\frac{\sum (x_i-\bar{x})(z_i-\bar{z})}{\sum (x_i-\bar{x})^2} =\frac{2}{2}=1,\qquad \hat a=\bar{z}-\hat b\bar{x}=\frac{8}{3}-2=\frac{2}{3}. $$

The held-out prediction for A, whose \(x=0\), is \(\hat z_{A,-A}=2/3\). The observed value is \(z_A=1\), so the prediction error, defined here as prediction minus observation, is \(e_A=2/3-1=-1/3\) log units. Its predicted-to-observed clearance ratio is \(\exp(e_A)=\exp(-1/3)\approx0.7165\): the predicted clearance is about 71.7% of the observed clearance for this illustrative species.

The subscript \(-A\) emphasizes that A was not used to estimate the line. Fitting one line to all four species and then reporting its fitted value for A would not be a held-out prediction.

Summarizing Bias and Prediction Error

Let \(z_s\) be the held-out observed log outcome for species \(s\), and \(\hat z_{s,-s}\) its LOSO prediction. Define \(e_s=\hat z_{s,-s}-z_s\), so positive errors indicate overprediction on the log scale and negative errors indicate underprediction. With one summary per species, common aggregate measures are the mean error (bias), mean absolute error (MAE), and root mean squared error (RMSE):

$$ \mathrm{Bias}=\frac{1}{S}\sum_{s=1}^{S} e_s,\qquad \mathrm{MAE}=\frac{1}{S}\sum_{s=1}^{S}|e_s|,\qquad \mathrm{RMSE}=\sqrt{\frac{1}{S}\sum_{s=1}^{S}e_s^2}. $$

Bias measures average direction and can be near zero when positive and negative errors cancel. MAE summarizes typical absolute error in the outcome's units. RMSE also has those units but gives relatively more influence to larger errors because it squares them before averaging. Report fold-specific errors alongside aggregates, especially when \(S\) is small.

Worked Example: Calculating LOSO Error Summaries

For the four-species data above, repeat the linear fit in each fold. The resulting predictions are A: \(2/3\), B: \(12/7\), C: \(3\), and D: \(8/3\). For example, when B is withheld, fitting A, C, and D gives slope \(13/14\) and intercept \(11/14\), hence the prediction at \(x=1\) is \(12/7\). The fold errors, prediction minus observation, are therefore

$$ e_A=-\frac{1}{3},\quad e_B=-\frac{2}{7},\quad e_C=1,\quad e_D=-\frac{4}{3}. $$

The mean error is

$$ \mathrm{Bias} =\frac{-1/3-2/7+1-4/3}{4} =-\frac{5}{21}\approx-0.2381\ \text{log units}. $$

Thus, on average, predictions are below observations on the log scale. The MAE is \(\{1/3+2/7+1+4/3\}/4=31/42\approx0.7381\) log units. The RMSE is \(\sqrt{\{1/9+4/49+1+16/9\}/4}=\sqrt{655/882}\approx0.8618\) log units. Since errors are log clearance differences, \(\exp(\mathrm{Bias})=\exp(-5/21)\approx0.7881\) is the geometric mean predicted-to-observed clearance ratio across these folds. It indicates a typical multiplicative tendency, not a fixed error for every species.

The log-scale bias has a useful interpretation. Because \(e_s=\ln(\widehat{CL}_s/CL_s)\), averaging errors and exponentiating gives

$$ \exp\left(\frac{1}{S}\sum_{s=1}^{S}e_s\right) =\exp\left(\frac{1}{S}\sum_{s=1}^{S}\ln\frac{\widehat{CL}_s}{CL_s}\right) =\left(\prod_{s=1}^{S}\frac{\widehat{CL}_s}{CL_s}\right)^{1/S}. $$

The last expression is the geometric mean of the fold-specific predicted-to-observed ratios. This follows from the logarithm rule that a sum of log ratios is the log of their product. It does not imply that the model is unbiased on the original clearance scale.

Interval Coverage Across Folds

For each held-out species, the training-fold procedure may also produce a predictive interval \([L_s,U_s]\) on the same scale as the held-out outcome. The empirical LOSO coverage is the fraction of held-out outcomes lying inside their corresponding intervals:

$$ \widehat C=\frac{1}{S}\sum_{s=1}^{S} \mathbf{1}\{L_s\le z_s\le U_s\}, $$

where the indicator equals 1 when the condition is true and 0 otherwise. State the number of covered species as well as the fraction; for few species, the fraction changes in large increments. Coverage should be evaluated against intervals produced without using the withheld outcome. A high or low observed fraction with only a few folds is uncertain evidence, not a precise estimate of future coverage.

Worked Example: Counting Held-Out Interval Coverage

Suppose the fold-specific procedure for the same hypothetical data gives the following illustrative 90% predictive intervals on the log scale. These intervals are assumed to have been generated using only the training species in each fold.

SpeciesObserved \(z_s\)Held-out intervalCovered?
A1[0.20, 1.20]Yes
B2[1.30, 2.30]Yes
C2[2.20, 3.80]No
D4[2.00, 3.30]No

A and B fall within their intervals; C is below its lower limit and D is above its upper limit. Therefore \(\widehat C=(1+1+0+0)/4=0.50\), or 2 of 4 species. This small example does not establish that the procedure's long-run coverage is 50%, nor does it justify changing the intervals to force agreement with a nominal 90% target. It shows how to calculate observed fold coverage and report its limited resolution.

Diagnostics, Comparisons, and Limits

Inspect each fold rather than relying only on the aggregate. A single large error may identify a species for which the fitted relationship extrapolates poorly, while errors that grow with predictor value may suggest that the model's form does not capture the relationship over the tested range. Compare each held-out prediction with the species' observed outcome and record whether the fold is interpolation or extrapolation relative to the training species. A pattern of systematic underprediction or overprediction is more informative than a near-zero mean error produced by cancellation.

LOSO is usually more appropriate than a random animal-level split when the question is prediction for a species absent from fitting. A random split can be useful for a different target—prediction for additional animals from species already represented—but it does not answer the same cross-species question. A single fixed training/test division can reserve a genuinely independent species set, but with few species it may use the available evidence inefficiently. LOSO uses every species as a test species once, though its fold results are dependent because their training sets overlap.

These results have important limits. With only a few species, error averages and coverage fractions are unstable and cannot support strong claims about a broad population of possible species. Species may also differ in ways not represented by the model predictors; good LOSO performance among the tested animals does not guarantee prediction in humans, a new biological domain, or a different experimental setting. If a species has several studies or many animals, retain the species grouping in every fold so records from the held-out species cannot leak into training. Finally, conclusions apply to the exact outcome definition and modeling workflow tested, not automatically to a different dose, endpoint, or model.

Common pitfall: “The model predicts well because a random split of individual animals had small errors.” That split may place members of every species in both sets, allowing the model to benefit from information about each test animal's species. To assess prediction for an unseen species, withhold all its records, repeat the fitting decisions within the remaining species, and evaluate its prediction separately.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A PK data set has 20 animals from each of three species. For LOSO validation, what is withheld in one fold?
  2. For one held-out species, the predicted and observed log clearance values are 3.1 and 3.5. Find the signed error and interpret its sign.
  3. Why can a mean error near zero coexist with poor predictions?
  4. Across five held-out species, four observed outcomes lie within their fold-specific intervals. Calculate empirical coverage and state one limitation of that result.
  5. A model developer selects covariates using all species before creating folds. Why is this problematic, and what should be done instead?

Solutions. (1) Withhold all 20 animals from one species; the other two species form that fold's training data. (2) With the convention prediction minus observation, \(e=3.1-3.5=-0.4\) log units, indicating underprediction for that species; the predicted-to-observed ratio is \(\exp(-0.4)\approx0.6703\). (3) Positive and negative errors can cancel in the mean, even when individual errors are large; inspect fold errors and MAE or RMSE as well. (4) Coverage is \(4/5=0.80\), or 80%; with five folds this estimate is coarse and does not establish future coverage. (5) The held-out outcome has influenced covariate selection, causing information leakage. Repeat selection using only the training species separately within each fold.