Week 12 — Nov 30: Chemometrics & Miscellaneous Methods, Final Paper Presentations

Week 11 used one instrument on one product; this week maps the rest of the field. Tidy data and tidymodels preprocessing, Kuhn and Johnson’s model panels and ensembles, designed experiments as the route from correlation to cause, chromatogram alignment and curve resolution, multivariate monitoring of a biologic batch, and high-dimensional flow cytometry for CAR-T, plus ICH M7 as the clearest case of a prediction accepted in place of an experiment. Final paper presentations run alongside.
**Clear your calendar for this session.** Final paper presentations run alongside the lecture, and the capstone problem is assigned here for the following weeks.

(Lecture 11.) Last week built the modeling vocabulary on one instrument and one product: NIR spectra on a small-molecule tablet line. That was deliberate depth. This week is breadth. The same discipline applies to tables of process data, to chromatograms, to a bioreactor’s 14-day trajectory and to millions of single cells in a CAR-T product. The six readings walk across that range, from a small-molecule tablet to a biologic to an advanced therapy.

The one idea

A predictive model is a hypothesis about data in exactly the way a method is a hypothesis about a molecule. It is fit on the evidence you have, valid only within its range, and tested by every new sample. Chemometrics is machine learning with a 40-year head start in regulated analytical science. Whatever the data look like, the questions are the same: what is one observation, what did the model learn, did it learn a cause or a coincidence, and where does it stop applying?

On teaching this honestly. Nobody in the department specialises in machine learning, and this session does not pretend otherwise. The goal is not to make you model builders. It is to make you competent clients and reviewers: able to say what a model must do, what data it needs, whether its output can be trusted, and where the regulations draw the line.

A map of the field

Chemometrics is easiest to navigate by the shape of the data and the question asked of it.

Data shapeExampleTypical questionWhere
A table: one row per batch, one column per variableProduct T’s material and process dataPredict an outcome; find what causes itReadings 1, 2, 3
A spectrum per sampleNIR of a granule or tabletIdentity; quantity; is it in the model’s domain?Week 11
A signal over time per sampleAn HPLC chromatogramAlign peaks so samples can be comparedReading 4
A matrix per sampleHPLC-DAD (time × wavelength)Resolve overlapping compoundsReading 4
A cube across samplesFluorescence EEMs (sample × excitation × emission)Resolve components uniquelyReading 4
A trajectory per batchBioreactor variables over 14 daysIs this batch travelling like good batches?Reading 5
A cell × marker matrix per sampleSpectral flow cytometry of a CAR-T lotWhich populations exist?Reading 6
An image with a spectrum per pixelHyperspectral imaging of a tabletWhere is each component?Not covered this term

What we cover this week

Six readings, each about 15 minutes. Readings 1–3 share one constructed tablet, Product T, so the preprocessing, the models and the experiment build on the same data. Code is in R, written to be read even if you have never written it.

#ReadingThe one idea
1Tidy Data and the Preprocessing RecipeHadley Wickham’s tidy-data rules decide what one observation is. A tidymodels recipe (zero and near-zero variance, correlation filter, imputation, transformation, scaling) is re-estimated inside every fold. SNV never looks at another sample; MSC does.
2Many Models, One QuestionKuhn and Johnson’s model panel: PLS, lasso, MARS, SVM, KNN, random forest, boosting and a neural network, on identical batch-grouped folds. Read the result as a distribution, choose the simplest model within one standard error, and weigh what an ensemble costs to keep validated.
3Correlation Is Not CausationThe model blamed moisture; the experiment found particle size and blend time. Sir Ronald Fisher’s randomization and factorial designs, and a fractional factorial that screens seven factors in 8 runs instead of 128. Aliasing is the price, and it is written down.
4From Raw Signal to Resolved SignalAlign drifting chromatograms (RRT, parametric time warping, COW, DTW) without warping away a new degradant. Then resolve co-elution with MCR-ALS and its rotational ambiguity, PARAFAC and its uniqueness, and spectral flow unmixing, which is the same equation.
5Watching a Biologic Batch GrowA mAb fed-batch as a cube of batches × variables × time. Raman soft sensors, batch-wise vs observation-wise unfolding, aligning unequal batches, why one golden batch is not enough, and a day-6 Q alarm that says “unusual”, not “bad”.
6Cells as DataA 25-colour CAR-T panel is a data matrix. Manual gating vs FlowSOM vs UMAP, a CAR+ CD3− population the release gates never examined, batch effects that look like biology, and one patient per lot.

How to use the readings

Presentations take much of the session, so the readings carry most of the content.

RoleReadingsWhy
Before class1, 2, 3The Product T arc: data, models, cause. Class assumes them.
Worked in classReading 3’s “the model blames moisture” case; reading 5’s day-6 alarm; reading 6’s CAR+ CD3− clusterThree judgment calls, one per modality, about 15 minutes each between presentations.
After class4, and the R snippets throughoutSignal processing is best read with a chromatogram in front of you.

(Instructor: adjust to the presentation schedule.)

Why R

Every snippet this week is R. Python is equally capable, and you will meet both at work. The case for R here is specific:

  • The modeling framework is R’s. Max Kuhn wrote caret and leads tidymodels; the recipe steps in reading 1 are tidymodels functions. Hadley Wickham’s tidyverse sets the conventions.
  • Statisticians tend to work in R. It was built for statistical analysis, and much statistical method development appears there first.
  • Cytometry analysis lives in R. flowCore, FlowSOM and CytoNorm are Bioconductor packages.
  • Chemometrics is well served. prospectr, mdatools, ptw and FrF2 cover readings 1–4.

The Python equivalents are scikit-learn (Pipeline, ColumnTransformer and VarianceThreshold play the role of a recipe) and pandas. The concepts transfer completely; the syntax does not matter much.

Worked case: where a prediction already replaces an experiment

ICH M7 (assessment of DNA-reactive impurities) is the clearest example of a computational prediction being formally accepted in lieu of data. For a new impurity, M7 allows a mutagenicity conclusion drawn from two complementary (Q)SAR systems, one expert-rule-based and one statistical, to substitute for an Ames test. If both predict non-mutagenic and there is no conflicting knowledge, no bacterial assay is run. The conditions are two orthogonal models (the same instinct as orthogonal analytical methods), a defined scope, documentation and versioning, and expert review on top.

The principle generalizes. Regulators’ emerging position on AI and models, including FDA’s 2025 draft guidance on AI to support regulatory decisions, is credibility proportionate to consequence: the evidence a model needs scales with how much it influences the decision and how serious a wrong decision would be. Predictive stability (ASAP) is on the same trajectory, with a formal home in the modernized Q1 annex. So is the dissolution IVIVC biowaiver, where an in-vitro model stands in for a clinical study. Language models are held to the same standard in Week 11 reading 8.

Where the analyst sits

The analyst states what a model must do in measurable terms and decides what one observation is. They own the quality of the training data and ask whether a predictor caused the outcome or merely travelled with it. They also decide, sample by sample, batch by batch and lot by lot, whether a result is inside the domain the model knows. None of that is machine-learning expertise. All of it is analytical judgment, the STEAM “M” and “A” at once, and it is why Week 1 said every scientist is now a data scientist. The refrain: science → evidence → reduced uncertainty → control → regulatory confidence → patient trust.

On the job

  • You are far more likely to be handed a fitted model and asked to defend a day’s predictions than to build one. Know how to read resampled RMSE, a T²/Q chart and a contribution plot before you know how to fit anything.
  • When someone shows you a variable-importance plot and proposes a process change, ask two questions: did that variable actually vary in the data, and what varied with it?
  • If your lab exports instrument data, ask what one row is. Most data-integrity and modeling problems start with that answer being unclear.
  • Learn to read R or Python well enough to follow a colleague’s analysis. You will be reviewing it.

For discussion

  • M7 accepts two (Q)SAR predictions in place of an Ames test, but not one. Why two, and why does that mirror how you use analytical methods?
  • A random forest and a fractional factorial disagree about which factor drives dissolution. Which do you believe, and what would change your mind?
  • Alignment (reading 4), batch synchronization (reading 5) and batch normalization (reading 6) all make samples comparable. What is the shared risk?
  • Rank by the evidence they need: a (Q)SAR call on an impurity; a Raman glucose model driving a feed pump; a FlowSOM cluster in a characterization panel; an NIR model releasing tablets.

The capstone

An applied problem, worked in teams over the following weeks: a comparability exercise after a manufacturing change; an out-of-specification investigation; a method transfer to a second site; or a specification-setting exercise for a new attribute. Deliverable: a short analytical control strategy and a defence of it, the argument a regulator would have to follow.

Final paper presentations

The paper is a critical analysis of an analytical method, technique, or problem of the student’s choosing, argued the way the course has argued all term: what question does this measurement answer, what decision does it support, how is the result defended, and where does it fail? Strong papers interrogate a real method, incident, or guideline rather than survey a topic. They name the failure modes and their detectability (Week 2), connect the technique to a regulatory expectation and a patient consequence, and say what would change the conclusion.

Format

(Instructor: fill in: capstone team size and deliverable format; presentation length and Q&A; whether the written paper is due before or after the talk; grading split across paper, presentation, and capstone; peer-review expectations. Confirm the pacing of six readings plus presentations in a single 3-hour slot, and consider whether presentations should spill into the make-up slot. Datasets for running the R snippets are still to be produced.)


Source note. Each reading carries its own sources. The modeling thread follows Kuhn and Johnson, Applied Predictive Modeling (2013), Kuhn and Silge, Tidy Modeling with R (2022), and Wickham, “Tidy Data” (2014). Experimental design follows Fisher (1935) and Box, Hunter and Hunter (2005). Signal processing, batch monitoring and cytometry cite the primary literature. The M7 case is anchored in ICH M7(R2) and the FDA draft guidance Considerations for the Use of Artificial Intelligence to Support Regulatory Decision-Making for Drug and Biological Products (2025). Product T, Batch 27 and Lot 0420 are constructed teaching cases. (Instructor: confirm current AI-guidance versions.)


Tidy Data and the Preprocessing Recipe

Hadley Wickham’s tidy-data rules decide what one observation is before any model is fitted. A tidymodels recipe then removes zero- and near-zero-variance predictors, filters correlated ones, imputes, transforms and scales, and is re-estimated inside every resampling fold.

Many Models, One Question

Kuhn and Johnson’s practice of fitting a panel of models built on different mathematics (PLS, penalized regression, MARS, SVM, KNN, random forest, boosting and a neural network) on the same resamples, comparing them honestly, stacking them into an ensemble and choosing what a regulated setting can defend.

Correlation Is Not Causation: From Designed Experiments to Sustained Pharmaceutical Quality

Use ISA-88 process recipes, FMEA, screening and response-surface optimization to transform predictive associations into pharmaceutical process understanding, design space, lifecycle control and organizational learning.

From Raw Signal to Resolved Signal

Clean and align analytical signals, investigate overlapping components with MCR-ALS and PARAFAC, and connect spectral flow cytometry to the same mathematical framework.

Watching a Biologic Batch Grow

Follow a CHO fed-batch from Raman soft sensors and three-way batch data through maturity alignment, multivariate monitoring, investigation and lifecycle learning.

Cells as Data: Flow Cytometry for CAR-T Release

A spectral flow panel gives every cell in a CAR-T product a 25-dimensional measurement. Manual gating, FlowSOM clustering and UMAP each see the data differently, batch effects masquerade as biology, and one patient per lot makes small-n honesty essential. The week’s chemometric discipline, applied to cells.