Prediction Is Not the Same as Association
Paired single-cell assays provide measurements from the same cells in more than one modality. For example, CITE-seq measures RNA and surface proteins in paired cells, while a multiome assay can measure RNA and chromatin accessibility in the same cells. This pairing makes a direct prediction question possible: how accurately can measurements in one modality predict a particular RNA feature in cells not used to fit the model?
The target here is a measured RNA feature, such as a gene’s transformed expression value. Predictors may be one or more protein measurements, ATAC accessibility features, or a reduced set of such measurements. The purpose is to assess predictive signal, not to establish that the predictor causes RNA expression. A model may predict well because both measurements reflect cell type, cell state, or another shared factor.
Let \(i\) index cells and \(g\) index an RNA feature. Write \(y_{ig}\) for the chosen response value for feature \(g\) in cell \(i\), and let \(\mathbf{x}_i\) be the vector of measurements from the predictor modality. In practice, \(y_{ig}\) is often a transformed or normalized expression value rather than a raw RNA count. The scale must be stated because prediction errors are expressed in that scale.
Model, Assumptions, and a Prediction Workflow
A simple starting model for one RNA feature is a linear regression:
Here, \(\beta_{0g}\) is an intercept, \(\boldsymbol{\beta}_g\) is a coefficient vector, and \(\varepsilon_{ig}\) is the part of the response not captured by the linear predictor. For least-squares fitting, the coefficients minimize the sum of squared residuals in the training cells. Linear regression is a modeling choice: it describes a linear conditional mean on the selected response scale, not necessarily a linear relationship between raw counts.
For interpreting the fitted conditional mean as the target of least squares, assume that the conditional mean of the residual is zero given the predictors: \(E(\varepsilon_{ig}\mid\mathbf{x}_i)=0\). For the usual coefficient standard errors and tests, additional assumptions such as independent errors and an appropriate variance model matter. Prediction assessment has a different requirement: held-out cells must represent the intended prediction population, and no information from them may influence model fitting or preprocessing. Normal residuals are not required to calculate held-out prediction errors.
A reliable evaluation separates the cells into training and test sets before any data-dependent processing. Transformation parameters, scaling values, feature filtering, and model tuning are learned using training data only. They are then applied to the test cells. When cells from the same donor or sample are correlated, assigning cells randomly to both sets can make the test set too similar to training data. To assess performance on new donors, split by donor or sample instead. The split should match the intended use of the model.
Name the RNA feature, its response scale, the predictor modality, and the cells with paired measurements.
Choose a split that reflects the intended prediction setting, such as new cells from observed samples or cells from new donors.
Estimate coefficients and choose any tuning parameters without using the test responses.
Calculate feature-level errors and compare them with a clearly defined baseline.
When there are many correlated predictors, ordinary least squares can fit training data very closely while producing unstable coefficients and poor predictions. Ridge regression controls coefficient size by minimizing squared error plus a penalty:
The intercept is usually not penalized. The tuning parameter \(\lambda\) controls the amount of shrinkage and should be selected using training data, for example through cross-validation within the training set. Predictor scaling matters for ridge regression because the penalty acts on coefficient sizes; scaling parameters must also be estimated from training data.
Held-Out Error and a Short Derivation
For \(m\) held-out cells, let \(y_{ig}\) be the observed value and \(\hat{y}_{ig}\) the prediction. Mean squared error (MSE), root mean squared error (RMSE), and mean absolute error (MAE) summarize different aspects of prediction error:
MSE is in squared response units and gives large errors extra weight. RMSE and MAE are in the response’s original units; RMSE is more sensitive to large errors. A common test-set \(R^2\) is \(1-\mathrm{SSE}_{\mathrm{model}}/\mathrm{SST}_{\mathrm{test}}\), where \(\mathrm{SST}_{\mathrm{test}}=\sum_{i\in\mathrm{test}}(y_{ig}-\bar{y}_{g,\mathrm{test}})^2\). It compares model error with variation around the test-set mean; it can be negative when the model’s squared error exceeds that benchmark. Because the test mean is not available when predicting new cells, also report performance against a practical baseline, such as predicting each test cell’s response as the training-set mean.
The least-squares fitting rule follows directly from minimizing squared residuals. For a single predictor \(x_i\), write \(Q(\beta_0,\beta_1)=\sum_i(y_i-\beta_0-\beta_1x_i)^2\). Setting the two partial derivatives to zero gives the normal equations:
The first equation implies \(\beta_0=\bar{y}-\beta_1\bar{x}\). Substituting this into the second equation and collecting terms gives \(\hat{\beta}_1=\sum_i(x_i-\bar{x})(y_i-\bar{y})/\sum_i(x_i-\bar{x})^2\), provided the predictor varies in the training data. The fitted line therefore minimizes training squared error; this derivation does not guarantee low error in new cells.
Worked Example: Predicting One RNA Feature From a Protein Measurement
Suppose a hypothetical paired-cell dataset uses a log-normalized RNA response for one gene and a scaled surface-protein measurement as its predictor. Four training cells have predictor values \(x=(0,1,2,3)\) and RNA values \(y=(1,2,2,4)\). Assume this simple example has no influential preprocessing or split leakage; the model is fitted only on these training cells.
The means are \(\bar{x}=1.5\) and \(\bar{y}=2.25\). The centered cross-product sum is \(4.5\), and the predictor sum of squares is \(5\), so
The fitted prediction is \(\hat{y}=0.9+0.9x\). In three held-out cells, suppose \(x=(1,2,3)\) and the observed RNA values are \((1.8,2.5,3.2)\). The predictions are \((1.8,2.7,3.6)\), so the errors \(y-\hat{y}\) are \((0,-0.2,-0.4)\). Thus, \(\mathrm{MSE}=(0^2+(-0.2)^2+(-0.4)^2)/3=0.0667\) and \(\mathrm{RMSE}=\sqrt{0.0667}=0.258\), in log-normalized RNA units.
The training-mean baseline predicts \(2.25\) for each test cell. Its MSE is \(((1.8-2.25)^2+(2.5-2.25)^2+(3.2-2.25)^2)/3=1.1675/3=0.389\). In this hypothetical split, the fitted model has lower test MSE than that baseline. This is evidence of predictive improvement for these held-out cells, not proof of a causal protein effect or a guarantee of performance in other populations.
Worked Example: Shrinkage With Two ATAC Predictors
Consider a hypothetical RNA feature predicted from two centered and scaled ATAC measurements. In four training cells, let the predictor columns be \(x_1=(1,1,-1,-1)\) and \(x_2=(1,-1,1,-1)\), and let the response be \(y=(2,1,-1,-2)\). These data give \(\mathbf{X}^\mathsf{T}\mathbf{X}=4\mathbf{I}\), \(\mathbf{X}^\mathsf{T}y=(6,2)^\mathsf{T}\), and mean response zero. With ridge parameter \(\lambda=2\), the intercept is zero and
Suppose two held-out cells have predictor rows \((1,1)\) and \((-1,1)\), with observed RNA values \(1.0\) and \(-0.5\). The predictions are \(1.333\) and \(-0.667\). Their errors are \(-0.333\) and \(0.167\), giving \(\mathrm{MSE}=((-0.333)^2+(0.167)^2)/2\approx0.0694\) in squared response units. The training-mean baseline predicts zero for both cells, with MSE \((1.0^2+(-0.5)^2)/2=0.625\). These calculations illustrate how to evaluate a fitted ridge model; in a real analysis, \(\lambda\) would be selected without reference to these test responses.
Worked Example: Comparing Feature-Level Errors
Suppose a hypothetical test set contains four cells and two log-normalized RNA features. For Gene A, observed values are \((0,1,2,3)\) and predictions are \((0,1,2,3.5)\). The absolute errors are \((0,0,0,0.5)\), so \(\mathrm{MAE}=0.5/4=0.125\), \(\mathrm{MSE}=0.25/4=0.0625\), and \(\mathrm{RMSE}=0.25\) log-normalized units.
For Gene B, suppose the observed values are \((0,0,0,4)\) and predictions are \((1,1,1,1)\). The absolute errors are \((1,1,1,3)\), giving \(\mathrm{MAE}=6/4=1.5\). The squared errors are \((1,1,1,9)\), so \(\mathrm{MSE}=12/4=3\) and \(\mathrm{RMSE}=\sqrt{3}=1.732\) log-normalized units. Gene B has substantially larger error on this scale. The comparison does not establish why its predictions are worse: sparse expression, cell composition, measurement noise, or model misspecification could all contribute.
Diagnostics, Alternatives, and Limitations
A held-out score should be interpreted alongside checks that reveal how it arose. Compare model error with the training-mean baseline for each feature. Inspect observed-versus-predicted values and residuals \(y_{ig}-\hat{y}_{ig}\) for systematic bias, such as underprediction at high expression. Check whether performance is driven by a few extreme cells, whether errors differ across samples or cell groups, and whether the response has little variation in the test set. A negative test-set \(R^2\) is possible and signals that the model’s squared error exceeds the test-set mean benchmark; it is not an arithmetic error by itself.
The main alternatives depend on the prediction goal. A training-mean baseline is essential for establishing whether predictors add value. Ordinary least squares is interpretable and appropriate when the predictor set is modest and not severely collinear. Ridge regression is useful for many correlated predictors because it shrinks coefficients, often improving stability. A nonlinear model may capture relationships that a linear model misses, but it brings additional tuning and overfitting risks; it must be evaluated on the same held-out cells and against the same baseline. Correlation between predicted and observed values can describe ranking or co-variation, but it does not measure calibration or error size and should not replace error metrics.
Errors are comparable across features only with care. RMSE and MAE inherit the response scale, so genes with different variability or abundance may not be directly comparable. Report the transformation and consider per-feature scores alongside any across-feature summary. A macro-average gives each gene equal weight, whereas pooling squared errors gives more influence to features with larger errors or scales. State which summary is used.
A common failure is data leakage: selecting features, scaling predictors, or tuning a model using all cells before the test split. Even without using test labels explicitly, this allows information from the test set to influence the fitted procedure and can make performance look too favorable. Another frequent problem is a cell-level random split when cells from the same donor are dependent; this can assess prediction among familiar donors rather than generalization to new ones. Finally, a good prediction score is not evidence that changing the protein or accessibility measurement would change RNA expression. Shared cell-state structure can explain predictive signal without a direct causal relationship.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A model has test MSE \(0.40\) and the training-mean baseline has test MSE \(0.65\). What can be concluded, and what cannot be concluded?
- Why must a predictor’s scaling parameters be estimated on training cells rather than on all cells before splitting?
- For four held-out cells, observed values are \((1,2,3,4)\) and predictions are \((1,1,3,5)\). Calculate MAE and RMSE.
- When would a donor-level split be more appropriate than a random cell-level split?
Solutions. (1) The model has lower squared prediction error than the stated baseline on this test set. This does not establish causation or guarantee the same performance in a different population. (2) Scaling on all cells uses information from held-out predictors to define the fitted procedure, causing leakage; training-derived scaling must be applied unchanged to the test data. (3) Errors are \((0,1,0,-1)\), so \(\mathrm{MAE}=(0+1+0+1)/4=0.5\). The MSE is \((0^2+1^2+0^2+(-1)^2)/4=0.5\), and \(\mathrm{RMSE}=\sqrt{0.5}=0.707\) response units. (4) Use a donor-level split when the intended use is predicting cells from donors not represented during model fitting, because cells from one donor may share biological or technical structure.