Lesson 2 of 4 Amazon SageMaker AI

Labelling and Preparing Data for Machine Learning

This lesson explains how SageMaker AI tools label data, prepare it visually and reuse features consistently. A model is only as good as its data.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish SageMaker Ground Truth from SageMaker Ground Truth Plus.
  • Describe how SageMaker Data Wrangler and SageMaker Feature Store prepare and reuse features.
  • Identify the AWS services that store and prepare data at scale.

Labelling data

Supervised learning needs labelled examples, and labelling is often the most expensive part of a project. AWS offers two levels of help. With SageMaker Ground Truth, you run the labelling jobs yourself, using your own staff, vendors from AWS Marketplace or the Amazon Mechanical Turk workforce. Its active learning labels easy examples automatically with a model and sends only uncertain ones to people, which reduces cost. With SageMaker Ground Truth Plus, AWS manages everything: you upload the data and your requirements, and an expert AWS workforce delivers the labels. The following table summarises the two.

ServiceHow it works
SageMaker Ground TruthYou run labelling jobs with your own staff, Marketplace vendors or Amazon Mechanical Turk. Active learning labels easy examples automatically and sends only uncertain ones to people
SageMaker Ground Truth PlusFully managed: you upload data and requirements, and an expert AWS workforce delivers the labels

Ground Truth can also collect human preference data for fine-tuning and evaluating generative models.

True or false

Ground Truth

Exam skills 1.3.4 · 3.3.3

Check your understanding of SageMaker Ground Truth and Ground Truth Plus.

Log in to try this activity Interactive activities are free with an account.

Preparing data and features

Two services help turn raw data into model inputs. SageMaker Data Wrangler imports data from sources such as Amazon S3, Amazon Redshift and Amazon EMR, shows its quality and distributions with visualisations and reports, and applies hundreds of built-in transformations, such as filling missing values, without code. SageMaker Feature Store is a central repository of features. Its online store returns features in milliseconds for real-time predictions, and its offline store keeps their history for training, so the same feature definitions are used in both places. The following table summarises the two services.

ServiceWhat it does
SageMaker Data WranglerImports data from S3, Redshift, EMR and more; explores it with visualisations and quality reports; applies hundreds of built-in transformations without code
SageMaker Feature StoreCentral repository of features: an online store for low-latency inference lookups and an offline store for training

Reusing feature definitions avoids training-serving skew, where production inputs are calculated differently from training inputs.

Scenario questions

Preparing data and features

Exam skills 1.3.4

Choose the SageMaker AI capability for each data preparation need.

Log in to try this activity Interactive activities are free with an account.

Supporting AWS services

Several AWS services support the storage and preparation of data for machine learning. The following list describes them.

  • Data usually lives in Amazon S3.
  • Large-scale preparation uses AWS Glue or Amazon EMR; the Glue Data Catalog stores schemas.
  • Amazon Macie finds sensitive data to remove or mask before training.
Scenario questions

Sensitive training data

Exam skills 1.3.4 · 5.1.3

Choose the service for a data preparation task.

Log in to try this activity Interactive activities are free with an account.
Worked example

Labelling 50,000 product images

An online shop wants a model that recognises product categories in seller photos, but its 50,000 images have no labels. Labelling them by hand would take months. With SageMaker Ground Truth:

StepWhat happens
1The team defines the categories and writes clear instructions with examples
2Human labellers (the company's staff or a vendor workforce) label an initial batch
3Active learning trains a model on those labels and labels the easy images automatically
4Only images the model is unsure about go to people, cutting cost substantially
5Labelled data is written to S3, ready for training

If the company had no staff to manage labelling at all, Ground Truth Plus would provide an expert workforce and run the whole project. Either way, Amazon Macie should first scan any accompanying text data in S3, such as seller descriptions and CSV manifests, for personal information that should not be in a training set (Macie analyses text-based objects, not image content).

Check yourself

Why does label quality matter so much for supervised learning?

Show answer

The model learns from examples with the correct answers, so inconsistent or wrong labels teach it the wrong patterns. Label quality limits model quality.

Exam Tips

Remember for the exam

  • To create labelled training data with human labellers, use SageMaker Ground Truth.
  • Fully managed labelling with an AWS workforce is Ground Truth Plus.
  • Visual, no-code data preparation is SageMaker Data Wrangler.
  • To reuse features consistently for training and inference, use SageMaker Feature Store.
  • To remove PII from training data, first find it with Amazon Macie.