Skip to main content

SageMaker AI: preparing data and features

The MLA-C02 deep dive on data preparation in Amazon SageMaker AI: Data Wrangler in SageMaker Canvas, Processing jobs, Feature Store online and offline stores, labeling with Ground Truth, measuring bias with Clarify, feature engineering techniques, class imbalance, and data splits.

7 min read · Last reviewed · MLA-C02

Loading your progress

Sign in to bookmark tutorials and track what you have read.

On this page

Already know this topic?

Try the Amazon SageMaker AI quiz: 9 questions on Amazon SageMaker AI.

What it is

This deep dive covers the SageMaker AI features for preparing data and features for training, at the depth of the MLA-C02 exam (Domain 1, which is 28% of the exam). It also covers the feature engineering and bias techniques that the exam asks about whatever the tool. For the service as a whole, start with the Amazon SageMaker AI tutorial.

Data preparation on AWS often starts outside SageMaker AI: AWS Glue and Amazon EMR transform data at scale, AWS Glue DataBrew cleans it visually, and AWS Glue Data Quality checks rules. SageMaker AI adds the steps closest to the model: exploring and transforming data for ML (Machine learning)Software that learns patterns from example data to make predictions or decisions, instead of following rules written by hand. A model is first trained on data, then used to make predictions on new data, which is called inference.Glossary entry, storing features for training and serving, labeling, and measuring bias.

Data Wrangler in SageMaker Canvas

Data Wrangler prepares data for ML with little or no code, and is now part of SageMaker Canvas, where you can also describe transformations in natural language.

  • Import from Amazon S3, Amazon Athena, Amazon Redshift, Snowflake, and Databricks.
  • Transform with built-in steps (handle missing values, encode categories, scale numbers, featurize text and dates) or your own Python, combined into a data flow.
  • Data Insights and Quality Report: finds missing values, outliers, duplicates, target leakage, and class imbalance before you train.
  • Export the flow to S3, a SageMaker Pipelines step, Feature Store, or a Python script, so the same preparation runs in production.

Processing jobs

A SageMaker Processing job runs a script (scikit-learn, Spark, or your own container) on managed instances for pre-processing, feature engineering, and evaluation, reading from and writing to S3. Choose it to run the same transformation code repeatedly in a pipeline, without keeping a cluster up.

Feature Store

Amazon SageMaker Feature Store stores features so that the same values are used to train and to serve, which avoids training-serving skew. Features live in feature groups, each record identified by a record ID and an event time.

Store What it is for
Online store Low-LatencyThe time between sending a request and receiving the response, usually measured in milliseconds. Distance and processing add to it; caching and serving users from nearby locations reduce it.Glossary entry lookups of the latest feature values during inference. Tiers: Standard (default), Standard V2 (update individual features in place), and InMemory, powered by Amazon ElastiCache, for the lowest latency (online only, no Customer managed keyA KMS key that you create, own, and manage: you control its key policy, rotation, and deletion. AWS managed keys, in contrast, are created and managed for you by an AWS service.Glossary entry)
Offline store The history of feature values in Amazon S3, cataloged in AWS Glue so you can query it with Athena, build training datasets, and look back to the values at a past time

With both stores on, Feature Store keeps them in sync. Ingest features in batches (for example from a Processing job, Glue, or EMR) or as streams with PutRecord, for example from a Lambda function or Apache Flink reading Kinesis (tasks 1.1.9 and 1.2.2). Applications in a VPC reach the Feature Store Runtime API (Application programming interface)A defined way for one program to ask another for data or actions, such as a set of HTTPS requests and responses. Every AWS service is controlled through its API, which the console, the CLI, and the SDKs call for you.Glossary entry privately through an interface VPC endpointA private connection from a VPC to an AWS service or another endpoint service without crossing the internet. Gateway endpoints, for Amazon S3 and DynamoDB, are route table targets; interface endpoints are network interfaces that use AWS PrivateLink.Glossary entry.

Labeling data with Ground Truth

Amazon SageMaker Ground Truth labels data for training with human workers: images (classification, bounding boxes, segmentation), text, video, and 3D point clouds. Choose a private workforce (your employees) for sensitive data, a vendor workforce, or Amazon Mechanical Turk for public data. Automated data labeling trains a model on human labels and labels the confident cases automatically, sending only uncertain ones to people, which lowers cost. Ground Truth Plus provides an expert workforce and project management as a managed service (task 1.3.2).

Measuring bias with Clarify

SageMaker Clarify measures pre-training bias in the data before you train, for a facet such as age or gender: for example class imbalance (one group has far fewer examples) and the difference in proportions of labels (one group gets positive labels more often). After training, it measures post-training bias in predictions and explains them with feature attributions (SHAP). Clarify runs as a Processing job and its reports appear in SageMaker Studio (tasks 1.3.3 and 1.3.4).

Feature engineering techniques

Technique What it does Use it when
Normalization (min-max) Rescales values to a range such as 0–1 Features on different scales, distance-based models, neural networks
Standardization (z-score) Mean 0, standard deviation 1 Roughly normal features; linear models and neural networks
Log transformation Compresses large values Skewed data such as income or prices
Binning Groups numbers into ranges Nonlinear effects, or noisy continuous values
One-hot encoding One column per category Categories with no order and few values
Label or ordinal encoding One integer per category Categories with a natural order
Feature splitting Splits one value into parts (date into day, month, weekday) A value hides several useful signals

Tree-based models such as XGBoost don't need scaling; linear models and neural networks do. Fit scalers and encoders on the training data only, then apply them to validation and test data, to avoid leakage.

Clean, balance, and split

  • Missing values: drop rows or columns, or impute with the mean, median, most frequent value, or a model. Outliers: detect (for example with Random Cut Forest or z-scores) and cap, transform, or remove. Duplicates: remove, especially across training and test sets (task 1.3.7).
  • Class imbalance (task 1.3.5): oversample the minority class (including synthetic examples with SMOTE), undersample the majority class, use class weights, augment images or text, and judge the model with precision, recall, F1, or AUC instead of accuracy.
  • Splits: separate training, validation, and test data; shuffle before splitting unless the data is a time series, which must be split by time; use stratified splits so each set keeps the class proportions; use cross-validation for small datasets (task 1.3.3).
  • Formats (task 1.1.5): Apache ParquetAn open-source columnar file format for analytics that stores compressed columns along with the schema. Querying Parquet files with Amazon Athena scans less data than CSV or JSON, so it is faster and cheaper.Glossary entry or ORC for Columnar storageStoring data column by column instead of row by row, so that analytical queries read only the columns they need, and similar values compress well. Amazon Redshift and the Parquet and ORC file formats store data this way.Glossary entry analytics and large training sets, CSV or JSON (JavaScript Object Notation)A text format for structured data made of name-and-value pairs and lists, such as {"bucket": "logs"}. IAM policies, most AWS API responses, and many CloudFormation templates are written in JSON.Glossary entry Lines for simple exchange, RecordIO-protobuf for some built-in algorithms.

Security, resilience, performance, and cost

Security

Processing jobs, Data Wrangler, and labeling jobs use IAM execution roles; encrypt data and outputs with KMS keys; run jobs in your VPC with S3 endpoints; use a private Ground Truth workforce for sensitive data. Remove or mask personal data before training (task 1.2.8), for example with Amazon Comprehend PII (Personally identifiable information)Information that can identify a person, alone or combined with other data, such as a name, email address, or passport number. Amazon Macie finds PII in Amazon S3.Glossary entry detection or Amazon Macie for data in S3.

Resilience

The offline store keeps a durable history in S3, so training sets can be rebuilt; pipelines rerun failed Processing steps.

Performance

Use Spark (Processing jobs, EMR, or Glue) for large datasets, columnar formats, and the InMemory online store for the lowest serving latency.

Cost

Pay for Processing and Canvas instance time, Feature Store reads, writes, and storage, and labeling per object. Automated data labeling and a smaller human-labeled sample lower labeling cost.

Monitoring

Processing and labeling jobs write to CloudWatch Logs and report state changes to EventBridge; CloudTrail records the API calls.

Comparisons

Need Choose
Visual data preparation for ML, export to a pipeline Data Wrangler in SageMaker Canvas
Visual cleaning for analysts, recipes on a schedule AWS Glue DataBrew
Rule-based data quality checks in ETL (Extract, transform, and load)Copying data from sources, cleaning and reshaping it, and loading it into a target such as a data warehouse. AWS Glue is the AWS serverless ETL service.Glossary entry AWS Glue Data Quality
Same features for training and real-time inference SageMaker Feature Store
Human labels for images or text SageMaker Ground Truth
Bias in a dataset, explanations of predictions SageMaker Clarify

Reverse mindmap: when the question points here

SageMaker AI data preparation: which feature?
  • Features
    • Same values in training and inference leads to Feature Store (online plus offline)
    • Lowest-latency feature lookups leads to InMemory online store
    • Feature values as of a past date leads to Offline store in S3
  • Labels and bias
    • Humans label images, sensitive data leads to Ground Truth, private workforce
    • Cut labeling cost leads to Automated data labeling
    • One group underrepresented leads to Clarify pre-training bias
  • Preparation
    • Visual transforms, export to a pipeline leads to Data Wrangler in Canvas
    • Repeatable Spark or scikit-learn step leads to Processing job
    • Rare positive class leads to Oversample, SMOTE, class weights
    • Skewed numeric feature leads to Log transformation

Key takeaways

  • Data Wrangler is now in SageMaker Canvas: import, transform, check quality and leakage, and export to Pipelines or Feature Store.
  • Feature Store's online store serves the latest values at low latency; the offline store in S3 keeps history for training, and syncing them avoids training-serving skew.
  • Ground Truth labels with human workforces, and automated data labeling cuts the cost.
  • Clarify measures bias before and after training and explains predictions.
  • Know the feature engineering techniques, how to handle class imbalance, and how to split data without leakage.

Sources

Show 6 more sourcesShow fewer sources

Test your knowledge

Loading your quiz progress

Sign in to test your knowledge with 9 questions on Amazon SageMaker AI.

  • Amazon SageMaker AI 8 min read

    SageMaker AI: deployment, MLOps, and monitoring

    The MLA-C02 deep dive on running models with Amazon SageMaker AI: choosing real-time, serverless, asynchronous, or batch inference, multi-model and multi-container endpoints, safe rollouts with deployment guardrails and shadow tests, autoscaling, endpoints in a VPC, Pipelines and the Model Registry, and monitoring for drift.

  • Amazon SageMaker AI 8 min read

    SageMaker AI: training and tuning models

    The MLA-C02 deep dive on training with Amazon SageMaker AI: built-in algorithms, script mode and your own containers, training data input modes, managed Spot training with checkpoints, distributed training, automatic model tuning, overfitting and convergence, experiments with MLflow, Debugger, and evaluation metrics.

  • Amazon SageMaker AI 7 min read

    Amazon SageMaker AI

    AWS's fully managed service to build, train, and deploy machine learning models: the 2024 rename, training and managed Spot training, built-in algorithms and JumpStart, the four inference options, autoscaling, Canvas, Feature Store, Pipelines, security, cost, and when to use the AI services instead.

Glossary Privacy Install the app

LetMeMaster is an independent educational project and is not affiliated with or endorsed by Amazon Web Services. Practice results do not predict actual exam outcomes.

© 2026 LetMeMaster. All rights reserved. Content may not be copied or redistributed without permission.

Proudly made in Canada

Version 0.0.12

Add LetMeMaster to your Home Screen

  1. Tap the Share button in your browser's toolbar. In Safari it is at the bottom of the screen, or at the top on iPad.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add. Open LetMeMaster from its icon on your Home Screen.