Let’s Get Certified
Module 03 / 13 · Data preparation for ML and AI

Build features that training and serving interpret the same way

A catalog accepts photographs and short descriptions.

Build features that training and serving interpret the same way

A catalog accepts photographs and short descriptions. Their vectors need a shared meaning for cross-modal search. The team must also encode numerical fields consistently, strip private material and retain source pointers for retrieved passages.

At 25:27 the speaker explains why image and text vectors must be comparable and when a vector index alongside relational data can help.

Work through the decision

After a model change, the new query encoder is compared against old document vectors. Both outputs have the same length. Why does recall drop?

Check your reasoning

The models may place similar ideas in different parts of their spaces. Version the encoder, rebuild or migrate the index with a compatible model, and compare retrieval on the same labeled queries before switching.

MLA-C02 recording · 25:27

Continue in the recording · 17:54 · 24:50.

Decisions and tradeoffs

Shared multimodal embedding space
Use a compatible model for the query and indexed representation. Equal vector dimensions alone do not guarantee comparable meaning.
Fit transforms on training data
Fit statistics and vocabularies after splitting, then persist them for validation and serving.
Versioned feature definition
Use one versioned transformation specification and verify equivalent online and training outputs for the same event.
Document chunking with source metadata
Keep coherent passages and traceable identifiers. Chunk boundaries, overlap and metadata affect recall and attribution.
Redaction before indexing
Remove or mask sensitive material before generating persistent searchable representations, following data policy.
Windowed stream transformation
Use a defined event-time window, lateness handling and a consistent feature key for changing aggregates.
Task-specific instruction examples
Training pairs should represent the response behavior, quality and formatting expected during inference.
Teacher-generated targets
Distillation uses a teacher’s outputs as learning targets for a smaller student, with a separate validation set.

Practice each guide skill

The numbers below follow the AWS task and skill identifiers.

  1. Design a Glue or SageMaker processing job to turn raw records into a schema-checked training partition.
  2. Publish a reusable feature definition and compare an offline value with the online result for the same entity and event.
  3. Window a stream by event time. Specify what a late arrival changes and how the revised feature is published.
  4. Encode categorical values and scale numeric features with statistics learned on the training partition. Handle an unseen category.
  5. Embed an image and a caption with compatible encoders. Compare positive and unrelated pairs before indexing the collection.
  6. Compare tokenization and normalization choices on accented product names, abbreviations and domain vocabulary. Keep a test set.
  7. Split a policy at semantic boundaries, attach its source version, then measure whether both sides of an exception remain retrievable.
  8. Redact private fields before indexing and check representative text and metadata for accidental retention.
  9. Prepare instruction pairs for supervised adaptation, licensed raw domain text for continued pretraining and teacher outputs for a smaller student.

Official objectives for this lesson

Related lesson · Choose a transformation for the data shape

Knowledge check

Build features that training and serving interpret the same way quiz

Answer 3 questions. Check each answer for an explanation.