smoke-test-ml-pipeline

Writes diagnostic pytest smoke tests that verify ML pipeline predict-time row-count correctness.

1|Updated Jun 22, 2026
One-click install
npx skills add https://github.com/probabl-ai/ibm-workshop --skill smoke-test-ml-pipeline-probabl-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smoke-test-ml-pipeline
Source: https://github.com/probabl-ai/ibm-workshop/tree/main/.bob/skills/smoke-test-ml-pipeline
Command: npx skills add https://github.com/probabl-ai/ibm-workshop --skill smoke-test-ml-pipeline-probabl-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, scikit-learn, skrub.

What problem does it solve? ML pipelines that load, featurize, and then split data silently drop cold-start rows at predict time, producing fewer predictions than expected. This Skill writes a small, diagnostic-by-construction pytest that catches that structural bug at iteration time, before it reaches production. ## Core Features & Use Cases - Hard row-count assertion: Builds train and predict environments from the real data source where the predict env carries no pre-history buffer, then asserts the prediction count exactly equals the predict-grid row count. - Soft metric sanity check: Compares smoke-set MAE against a hardcoded 3x CV-mean bound from the experiment's design note to detect NaN-poisoned predictions. - Fixture construction guidance: Covers three source-binding shapes (directory of raw files, predict-grid plus history sources, materialized X/y) using pytest's tmp_path for ephemeral fixtures. - Use Case: After building a forecasting pipeline with skrub, you need an executable proof that predict-time featurization does not drop rows. This Skill produces tests/smoke/test_NN_experiment.py that fails deterministically on the buggy pipeline shape and passes on the correct one. ## Quick Start Write the smoke test for experiment 01_baseline by reading its design note and script, then constructing train and predict environments from the real data directory with an exact row-count assertion.

Frequently Asked Questions about smoke-test-ml-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a smoke test for an ML pipeline in pytest?

Build a train environment and a predict environment from the real data source, fit the learner on train, predict on the predict env, and assert the prediction count exactly equals the predict-grid row count. The predict env must carry no pre-history buffer so the test is diagnostic by construction.

Why is my smoke test failing on prediction row count?

A row-count mismatch means the pipeline computes features after splitting, so predict-time featurization drops cold-start rows with NaN lag or rolling values. Fix the pipeline shape by placing the X marker early and referencing upstream history nodes from feature steps rather than loosening the assertion.

Can the smoke test import skore or tracking libraries?

No. The smoke test uses only the predicting package's API, meaning skrub's fit and predict plus sklearn.metrics for the soft assertion. CV-mean baselines are hardcoded from the design note's headline so the test runs in any environment with skrub and sklearn installed.

Should the smoke test use synthetic fixture data?

No. The fixture must read the real data source through the same loaders the experiment uses, because synthetic fixtures skip the loaders that actually break in production. Use pytest's tmp_path when the source binding requires on-disk inputs.

What does a smoke test catch for IID tabular problems?

For pipelines with no cross-row dependencies, the diagnostic-by-construction property does not apply, but the test still catches loader bugs that drop or duplicate rows, prediction shape mismatches, and NaN-poisoning from encoders seeing unseen categories via the soft metric assertion.