For the complete documentation index, see /llms.txt. The full corpus is available at /llms-full.txt. Most pages have a raw markdown variant; append .md to the URL or send Accept: text/markdown.
Try out Invert Assist free.Try Assist

Docs  |  Assist Use Cases

Find Unusual Batches with Principal Component Analysis (PCA)

A batch can have every measurement within its limits and still not be normal. Ask Assist which new batches differ from your stable process. It builds a PCA model from your normal batches, checks that the model works, scores the new batches and tells you which measurements drive each flag.

Ask a hard data science question. Assist builds the model, tests it and explains the result, with a record that anyone can review and rerun.

The problem

Most teams check each measurement against its own limit, for example ±3 SD. This misses batches where the measurements no longer agree with each other: the outlet temperature goes down while the heater power stays normal, but each value alone is still in range. A multivariate model finds these batches. Building one correctly is specialist work: fit the model, set the control limits, prove that it finds real faults and explain every flag. In this example, Assist did all of it in one session of about 20 minutes.

What you do

The experiment has 1,160 batches. Each batch has one value for six measurements: inlet temperature, outlet temperature, heater power, flow, pump speed and line pressure. A metadata field gives the role of each batch: 300 reference batches (normal), 200 calibration batches (a separate stable set) and 660 new batches without labels. The data in this example are simulated.

Attach your model spec (the method and the outputs you require) and your guidelines for the analysis, then ask:

"Assess the SPC PCA experiment using the attached batch-deviation PCA spec. Reference batches define normal; calibration batches are a separate stable set; application batches are unlabeled. Fit on reference only, show T²/Q against 95/99% limits, the score plot and contribution plots for flagged batches, distinguish multivariate anomalies from single-parameter limit hits, and save the model and development record."

What Assist does

  1. Checks the data: the number of batches in each role, no duplicates, no missing values, and batch IDs that match the run names.
  2. Keeps the data sets apart: it fits the model only on the reference batches. It uses the calibration batches only to check false alarms, and it scores the new batches once, after the model is frozen.
  3. Builds the model: it selects the number of principal components with evidence, then calculates the 95% and 99% limits for two statistics. T² flags a batch that is far from normal but behaves in the normal way. Q flags a batch where the normal relations between the measurements are broken.
  4. Tests detection on simulated faults: it adds known faults to copies of the calibration batches and checks that the model finds them and names the right measurement. It also compares the model with a simple ±3 SD check on each measurement.
  5. Measures false alarms: it scores the stable calibration batches and counts how many pass a 99% limit.
  6. Scores the new batches: each batch gets a result and a failure type. Action: T² or Q is above its 99% limit. Warning: T² or Q is above its 95% limit, but both are below the 99% limit. Within limits: both are below the 95% limit. Assist puts the flagged batches into groups by the measurements that drive them, and makes the score plot, the T² vs Q plot and the contribution plots.
  7. Saves the work: a model with a scoring function for new batches, which gives exactly the same scores as the development, and a development record. The development record is a report that contains all the code, so another person can review it and rerun it from start to finish.

Below, the session after Assist completed the work. On the left, Assist's summary of what it saved and why. On the right, the development record, which starts with the executive summary.

The Assist session with the saved PCA model and its development record: on the left Assist's summary, on the right the executive summary of the development record

What Assist found

The model uses 2 principal components, which explain 97.4% of the variance. Observed false-alarm rate: 3 of 200 stable calibration batches (1.5%) pass a 99% limit.

The model finds faults that the ±3 SD check misses. Assist added simulated faults to copies of the 200 calibration batches. The PCA model (blue) found all the faults where one measurement breaks the normal pattern. The ±3 SD check (orange) found only 19% to 52% of them. When the whole thermal block shifts along its normal pattern, both find about the same number (88% and 86%).

Bar chart of the simulated faults found by the PCA model and by the ±3 SD check: 100% against 52%, 19% and 52% for the three single-measurement faults, and 88% against 86% for the thermal block shift

A quarter of the new batches differ from the reference. 171 of the 660 new batches (25.9%) reach action level, against 1.5% in the stable calibration batches. They fall into two main groups:

GroupBatchesWhat it looks likeFound by the ±3 SD check
Thermal correlation break (Q)116Inlet and outlet temperature move in opposite directions, heater power stays normal0
Thermal block shift (T²)44Inlet temperature, outlet temperature and heater power all about 4 SD higher, together43
Other, near the limit11Q just above its limit, mixed drivers1

The T² vs Q plot shows that the two groups are different types of deviation. The Q group (orange) is above the Q limit: the normal relations between the measurements are broken. The T² group (blue) is to the right of the T² limit: the batches are far from normal, but the measurements still agree with each other.

T² vs Q plot of all batches: the Q group in orange above the Q limit, the T² group in blue to the right of the T² limit, and the batches that are not flagged in grey inside the 99% limits

127 of the 171 flagged batches have every measurement within ±3 SD. A check per measurement cannot see them. Assist also shows the opposite case: 5 batches have one measurement just past ±3 SD, but the other measurements moved with it in the normal way. These batches get only a warning, because they are not unusual as a whole.

Each flag comes with the measurements that drive it. A contribution plot shows which measurements cause the flag, here for one batch from each group:

  • E0453 (Q group): inlet and outlet temperature disagree, each within ±2 SD, while heater power is normal.
  • E0019 (T² group): inlet temperature, outlet temperature and heater power are all about 5 SD higher, together. The hydraulic measurements are normal.

Contribution plots for batch E0453, where inlet and outlet temperature drive Q, and batch E0019, where the three thermal measurements drive T²

Assist then gives an order for the investigation: the Q group first (the heat balance across the heater does not close, possibly because of a temperature sensor), then the T² group (confirm whether the setpoint changed), then the batches near the limit.

Assist also says what the result does not show. A flag means "different from the reference batches", not "out of specification". The contribution plots show where to look, not the cause. For a shift of the whole thermal block, the model finds about the same number of batches as the ±3 SD check. Its added value there is that it tells you the type of deviation.

Why it matters

  • It finds what limit checks miss. 127 of the 171 flagged batches look normal on every single measurement.
  • Each flag comes with a reason. You see which measurements drive the flag and whether the batch is shifted or its measurements no longer agree.
  • Rigour is built in. Separate data sets, a false-alarm check, simulated faults as a test and a comparison with a simple ±3 SD check.
  • The work stays useful. The saved model scores the next batches, and the development record lets someone else review and rerun every step.

Example prompts

  • "Score the batches from last month with the saved SPC PCA model and list the batches at action level."
  • "Show the contribution plot for the five batches with the highest Q."
  • "Which flagged batches would our ±3 SD check also have caught?"

Related guides