liveBook · Manning

Training

As explained in Machine Learning Platform Engineering

Model training is the process of fitting a machine learning model to data by optimizing its parameters according to a training objective.

Model training fits a model to prepared data. In a production ML system, the training process also needs to be reproducible, modular, and connected to data preparation and validation. A notebook can support experimentation, but a versioned pipeline component can run consistently across environments and retain the evidence needed to assess each run. section 1.1.1 section 8.1

For an ID card detector, the training component has three responsibilities:

  • Download training, validation, and test images with their labels, then configure the dataset paths and splits. section 8.1
  • Initialize a pretrained YOLO model and run training with a dataset configuration, image size, epoch count, and batch size. section 8.1.2
  • Save weights, plots, and sample inferences in a project directory so training progress and validation results can be inspected. section 8.1.2
Listing 8.3 Writing the data configuration to YAML
from ultralytics import YOLO

model = YOLO('yolov8n.pt') #1
results = model.train( #2
    data='custom_data.yaml',
    imgsz=640,
    epochs=epochs,
    batch=batch,
    name='yolov8n_custom',
    project=project_path) #3

The Ultralytics example initializes `yolov8n.pt` and calls `model.train` with `custom_data.yaml`. The pipeline supplies `epochs` and `batch`; `project_path` collects the resulting artifacts. section 8.1.2

Choose settings against three constraints: training time, available compute, and required performance. Image size affects memory use and training time; batch size and model architecture also need to fit the available resources. Prefer defaults that work reliably in the pipeline over manual tuning that is difficult to repeat. section 8.1.2

The same pattern with structured data

A movie recommender starts from prepared Parquet data divided into training, test, and validation splits. Its components check incoming data quality, train and validate a model, and use MLflow to log experiments and track model versions. The training infrastructure carries over even though the task and artifacts differ from object detection. section 9.3

Training is not the end of the loop. If evaluation metrics fall short, revisit the architecture or the quality and quantity of the data; a problem found during training may require returning to data preparation. Orchestration makes those repeated runs easier to automate and trace. section 1.1.1

How Machine Learning Platform Engineering covers it

How deep it goes
Works through component responsibilities, a YOLO training call, configuration choices, and artifacts, but not the recommender algorithm’s details.
Examples
Uses an ID card detector trained with YOLO and a movie recommender trained from split Parquet data.
What it assumes
Starts from collected, prepared data; teaches training configuration while leaving extensive data exploration and recommender algorithm details aside.
What you can do after
Apply it via Ultralytics YOLO and pipeline components to run reproducible training and inspect validation artifacts.
How it connects
Connects training to data preparation, validation, pipeline orchestration, experiment tracking, and model versioning.

Also explained in

Compare how 24 books explain training →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.