Overview
Curated: · Written: · Reviewed:
Machine Learning in Computational Biology
In one line
Predict a biological label from high-dimensional, related data, and report only the performance on units the deployed model will actually meet. Reach for it when the task is sequence, expression, structure, molecule or imaging prediction with a stated downstream decision.
Key definitions
- Unit of independence: the thing that must not straddle the train/test boundary (donor, homology cluster, chromosome, scaffold, batch, date).
- Leakage: any test-side information reaching training, including fit-dependent preprocessing, homologs, or batch-correlated labels.
- Pseudoreplication: counting cells or windows from one donor as independent samples.
- Calibration slope and intercept: how observed risk tracks predicted risk. Slope near 1 and intercept near 0 are the target.
- Precision at k and enrichment: positives in the top k divided by k, compared with the prevalence baseline.
- Nested cross-validation: outer folds score the whole selection procedure, inner folds do the tuning.
Formulas and complexity
At prevalence pi = 0.01, TPR 0.90 and FPR 0.01: PPV = 0.009 / 0.0189, about 48%. Of 50,000 accounts, roughly 15% of flagged accounts are fraud at TPR 0.90 and FPR 0.05, so the threshold decides the answer.
Newsvendor critical ratio for a weekly order with shortfall cost 40 and leftover cost 10:
Order at the 80th percentile of the predictive distribution.
How it works
- Define the unit of independence and the deployment population before choosing a model.
- Split on that unit (whole clusters, chromosomes with buffers, donors, scaffolds, dates) and assign once.
- Fit every preprocessing step, batch correction and feature selection inside the training fold only.
- Tune in inner loops, freeze the test set, and report the outer estimate.
- Set the threshold on development data from costs and capacity, then check calibration and subgroups before deployment.
When to use and when not to
| Situation | Prefer | Why |
|---|---|---|
| Hundreds of samples, engineered features | Regularized linear model or boosted trees | Fast, interpretable, often competitive |
| Long raw sequence or image, enough independent data | Deep model | Learns motifs and structure |
| Few labeled proteins | Pretrained embeddings with a logistic-regression baseline on a cluster split | Transfer helps only if pretraining did not see your test homologs |
| Deployment on new donors or sites | Donor- or site-held-out split | Matches the actual question |
| Rare positives, limited follow-up | Precision at k, AUPRC | AUROC is dominated by true negatives |
| Causal claim | Prediction model alone | Attribution is not causation |
Traps interviewers probe
- Random split over related rows (cells, windows, homologs). Fix: split by donor, chromosome or a 30% identity cluster, and name the split in the report.
- Scaling, imputation or feature selection on the full dataset. Fix: put them in a Pipeline so each is refit per training fold.
- Reusing the test set after tuning. Fix: score it once; use nested CV when data are too small for a fixed validation set.
- Batch or site as a shortcut. Fix: hold out a batch and check whether batch is confounded with label. If treatment and batch are confounded, batch correction removes the biology too.
- Reading AUROC as precision. Fix: report precision, PPV and calibration at the frozen threshold.
Interview tips
Open with: "The number depends on the split, so first I need the unit of independence and the deployment population."
Expected follow-ups:
- Why did accuracy fall after clustering? The model did not change. The earlier number measured recall of near-duplicates.
- At 1% prevalence with 50 follow-up slots, which metric? Precision at 50 against a random baseline of about 0.5 expected hits, plus calibration if the list drives capacity.
- When not to use a pretrained protein model? When tabular features already carry the signal, or when the pretraining corpus overlaps your test homologs.
- Are 3D displacement heads equivariant? A displacement vector must rotate with the input (Δr_i maps to R Δr_i, translation cancels), and a scalar energy such as ΔG must stay unchanged.
30-second outline: name the unit and the split; state the leakage risk and its fix; give the number with its baseline and calibration; name how the threshold was set and which external check remains.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.