Which testing practice is appropriate for the FEATURE ENGINEERING code in an ML pipeline?
- A. Unit tests that assert transformation outputs for known inputs (e.g., correct encoding, no nulls introduced)✓ Correct
- B. Only monitoring the final model's accuracy in production and rolling back when it drops below a threshold
- C. No unit tests, since ML pipelines are non-deterministic; rely on model validation metrics to catch feature bugs
- D. Manually inspecting a sample of transformed rows in a notebook display once before the first job run is deployed
Explanation
Feature engineering is deterministic transformation logic, so unit tests asserting expected outputs for known inputs catch regressions early. Skipping unit tests in favor of model metrics, relying only on production accuracy monitoring, or a one-time manual inspection of rows all leave defects to surface late.