Which parameters of a fitted PCA must be persisted to transform new data at inference time?

Quick Overview

Asks which values from a fitted PCA model have to be saved so new data can be transformed the same way at inference time. Tests practical understanding of the PCA transform, whitening, upstream preprocessing and safe model persistence.

Which parameters of a fitted PCA must be persisted to transform new data at inference time?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

Which parameters of a fitted PCA must be persisted to transform new data at inference time? ```hint Write out transform Write `pca.transform` as plain matrix operations and list every array that appears in it. Then ask what happens to the raw input before it reaches the PCA step. ``` ### What a Strong Answer Covers - The training mean and why new data must be centered with it. - The projection matrix and why it is stored instead of refit. - The extra values needed when whitening is turned on. - Upstream preprocessing that has to travel with the PCA step, and what does not need to be stored at all. ### Follow-up Questions - A colleague refits PCA every night on the latest data while the downstream model stays fixed. What breaks, and how would you detect it? - How would you monitor at inference time whether the stored PCA still fits the incoming data? - How do you map PCA scores back to the original feature space, and which parameters does that need? - What would you persist if the model will be served from a different language or library than the one used for training?

Overview: Asks which values from a fitted PCA model have to be saved so new data can be transformed the same way at inference time. Tests practical understanding of the PCA transform, whitening, upstream preprocessing and safe model persistence.

Nov 24, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

Which parameters of a fitted PCA must be persisted to transform new data at inference time?

What a Strong Answer Covers Guidance

  • The training mean and why new data must be centered with it.
  • The projection matrix and why it is stored instead of refit.
  • The extra values needed when whitening is turned on.
  • Upstream preprocessing that has to travel with the PCA step, and what does not need to be stored at all.

Follow-up Questions Guidance

  • A colleague refits PCA every night on the latest data while the downstream model stays fixed. What breaks, and how would you detect it?
  • How would you monitor at inference time whether the stored PCA still fits the incoming data?
  • How do you map PCA scores back to the original feature space, and which parameters does that need?
  • What would you persist if the model will be served from a different language or library than the one used for training?