← Todas las plantillas

Experimentos registrados, datos versionados, cada modelo se entrega con un informe de evaluación.

Constitution — ML model training

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.

  1. Experiments are tracked. Every training run logs its code commit, configuration, hyperparameters, metrics and artifacts to the experiment tracker (MLflow or equivalent). A result that cannot be traced to a logged run is not reported.

  2. Data is versioned. Training, validation and test sets are versioned (DVC, lakeFS or dataset snapshots), and each run records the exact version it used. Rebuilding a dataset never overwrites a version that a model was trained on.

  3. Every model ships with an evaluation report. A model is promoted only with a report of its metrics on the frozen test set, compared with the current production model and a simple baseline, broken down by the slices named in the spec.

  4. Runs are reproducible. Seeds are fixed for Python, NumPy and PyTorch, dependencies are locked, and the training image is pinned. Running the same configuration twice gives metrics within the tolerance stated in the plan.

  5. The test set stays untouched. The test set is split once, by a rule that prevents leakage (by time, user or group as the spec says), and is never used for tuning or early stopping. Any leakage found invalidates the affected runs.

  6. Configuration, not code edits. Hyperparameters and paths come from versioned config files, not edited constants. A sweep is a list of configurations, each one a tracked run.

  7. Models are registered and served the same way. Promoted models go to the model registry with their signature, the preprocessing they need and their evaluation report. Serving uses the same preprocessing code as training, and a test checks both give the same features.

  8. Production is monitored. Input drift, prediction distribution and, when labels arrive, live accuracy are tracked against the evaluation report. Crossing a threshold in the plan raises an alert and opens a retraining review.