Courseiva
MLA-C01Chapter 3 of 16Objective 1.3

Data Transformation and Feature Engineering with SageMaker

Exam objective 1.3 demands you master performing feature engineering and data transformation for machine learning. This concept solves the fundamental problem that raw data is almost never ready for an ML model — it is messy, inconsistent, and missing the signals the model needs to learn from. For your MLA-C01 exam, understanding how SageMaker provides purpose-built tools to automate and scale this crucial prep work separates a passing score from a failing one.

12 min read
Intermediate
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Data Transformation and Feature Engineering with SageMaker

The Master Baker's Recipe Book Analogy

The Master Baker at a high-end patisserie receives a delivery of dozens of different raw ingredients: flour, eggs, butter, sugar, vanilla pods, fresh berries, and chocolate blocks. These ingredients are like raw datasets. Before any baking can happen, the Master Baker must transform each ingredient into a usable form. Eggs are cracked and separated into yolks and whites. Butter is softened to room temperature. Berries are washed, hulled, and sliced. Chocolate is melted and tempered. This initial preparation is 'Data Transformation' — taking raw data and cleaning it, normalising it, and converting it into a standard format.

But the real artistry goes further. The Master Baker doesn't just prepare ingredients; she extracts 'features' that create the signature taste of her celebrated blackberry-chocolate torte. She knows that the blackberry's tartness needs to be balanced by the chocolate's bitterness, so she creates a feature called 'acidity-to-bitter ratio'. She also measures the viscosity of the batter, a feature that predicts baking time. This is 'Feature Engineering' — creating new, informative variables from the existing data that make the final prediction (in this case, a perfect torte) possible. SageMaker is the Master Baker's state-of-the-art kitchen. It provides the tools (like SageMaker Data Wrangler for transformations and SageMaker Feature Store for storing these features) to systematically organise this messy process, letting her scale from baking one torte to managing a nationwide chain of patisseries without losing consistency or quality.

How It Actually Works

To understand data transformation and feature engineering, you first need to appreciate that machine learning models are extremely picky eaters. They cannot consume text, dates, categories, or missing values directly. They only understand numbers. Furthermore, even when your data is numeric, it might be on wildly different scales — for example, one column representing 'years of experience' (ranging 0 to 40) and another column for 'annual salary' (ranging 0 to 200,000). A model would incorrectly prioritise salary simply because the numbers are larger. This is where data transformation steps in.

Data transformation is the process of converting raw data into a clean, consistent, and numerical format that a machine learning model can interpret. Common transformations include handling missing values (either filling them in with the average, median, or a predicted value — known as 'imputation'), scaling numerical values so they all fall within a similar range (using techniques like 'min-max scaling' which squeezes values between 0 and 1, or 'standardisation' which centres them around a mean of 0 with a standard deviation of 1), and encoding categorical variables (turning text labels like 'red', 'blue', 'green' into numbers, often using 'one-hot encoding' where each category becomes its own binary column). This step is essential because 'garbage in equals garbage out' — a poorly transformed dataset will lead to an unreliable model.

Feature engineering is a more creative and advanced step that builds on top of transformation. While transformation cleans data into a usable format, feature engineering creates entirely new columns (features) from existing data that better capture the underlying patterns. For instance, if you have a dataset of house sales with 'date of sale' and 'square footage', you might engineer features like 'day of the week', 'month', or 'price per square foot'. A more sophisticated example: from a timestamp, you could extract 'hour of day' to help a model predict coffee shop traffic. From GPS coordinates, you could derive 'distance to city centre'. The goal is to provide the model with features that have strong predictive power, making its job of finding correlations much easier.

This replaces the old, manual process of writing custom Python scripts and using libraries like Pandas and Scikit-learn. While those are still valid, SageMaker offers integrated, serverless, and scalable alternatives. SageMaker Data Wrangler is a visual interface that lets you import data from multiple sources (Amazon S3, Athena, Redshift) and then apply transformations using point-and-click, without writing a single line of code. It supports over 300 built-in transforms. Once you are happy with the transformations, you can export the processing logic as a script to automate it for new incoming data. SageMaker Processing jobs then execute these transformation scripts at scale on managed clusters, handling terabytes of data. SageMaker Feature Store is a dedicated repository where you can store, share, and reuse the engineered features across multiple models and teams. This prevents data scientists from duplicating work — a common problem in large organisations.

For the exam, you need to know the core AWS services involved. The main ones are:

Amazon S3 (Simple Storage Service): The primary storage location for raw and transformed data.

SageMaker Data Wrangler: A visual tool to explore, transform, and prepare data without coding.

SageMaker Processing: A fully managed service to run custom data processing scripts (Python, Spark) at scale.

SageMaker Feature Store: A centralised store for features, enabling consistency across training and inference.

Amazon Athena: A serverless query service to analyse data directly in S3 using standard SQL, useful for initial exploration.

You must also understand the difference between training and inference pipelines. During training, you transform the training dataset and store the required parameters (for example, the min and max values used for scaling) so you can apply the exact same transformation to new, unseen data during inference (when your model makes predictions). SageMaker automatically handles this if you use its built-in SDKs.

The exam will also test your knowledge of specific feature engineering techniques that SageMaker supports natively. These include:

One-hot encoding for categorical features.

Normalisation (min-max scaling) and standardisation (Z-score scaling).

Handling date/time features by extracting components like year, month, day, day of week.

Text feature extraction using techniques like TF-IDF (Term Frequency-Inverse Document Frequency) and BERT embeddings via SageMaker's built-in algorithms.

Image feature extraction using pre-trained models.

A common mistake is assuming that feature engineering is a one-time task. In reality, it is iterative. You engineer features, train a model, evaluate performance, and then engineer new features to try to improve accuracy. This cycle repeats until the model is satisfactory.

End-to-end flow from raw data to deployed model using SageMaker data transformation and feature engineering tools.

Walk-Through

1

1. Import Raw Data into SageMaker

Start by uploading your raw data to Amazon S3. Then use SageMaker Data Wrangler to import it from S3. This is the foundation; without data, no transformation is possible. Data Wrangler can also connect to Athena, Redshift, and other sources.

2

2. Explore and Visualise Data

Use Data Wrangler's built-in dashboards to view distributions, missing values, and correlations. This helps you decide which transformations are needed. For example, if you see a column with 30% missing values, you plan imputation.

3

3. Apply Transformations

Select and apply the required transformations from Data Wrangler's library (e.g., fill missing values with median, normalise numeric columns, encode categories). Each transformation is added as a step in a visual workflow, so you can see the effect immediately.

4

4. Engineer New Features

Create new columns from existing ones using built-in functions (e.g., extract 'day of week' from timestamp, create 'price per square foot' from price and area). This step adds predictive power to your dataset.

5

5. Export the Transformation Pipeline

Once satisfied, export the workflow as a Python or PySpark script. This captures the exact sequence of steps so you can automate the same transformations on new data using SageMaker Processing or pipelines.

6

6. Store Features in Feature Store

Register the most useful engineered features into SageMaker Feature Store. This makes them available for future training jobs and real-time inference, preventing redundant effort and ensuring consistency.

7

7. Run a SageMaker Processing Job

Execute the exported script at scale using SageMaker Processing. It launches a managed cluster to run the transformation on the entire dataset, saving the output back to S3. This is the production-grade, repeatable version of your manual work.

What This Looks Like on the Job

Consider a real-world scenario: a multinational e-commerce company called 'ShopGlobal' wants to build a machine learning model that predicts whether a customer will buy a product within the next seven days. They have historical transaction data, customer profile data, and web session logs. The raw data is a mess. Transaction dates are in different formats across regions (DD/MM/YYYY vs MM/DD/YYYY). The customer profile data has missing ages and some fields like 'Country' are stored as free-text (e.g., 'USA', 'US', 'United States', 'U.S.A.'). The web session logs include timestamps with milliseconds and URLs.

The data engineering team at ShopGlobal uses SageMaker Data Wrangler to do the initial transformation. They connect to their raw data stored in Amazon S3. Using the visual interface, they perform the following steps in sequence:

Parse and standardise all date fields into ISO 8601 format (YYYY-MM-DD).

Clean the 'Country' column by mapping all variations to a standard set of country codes.

Impute missing ages using the median age of customers from the same region.

Normalise the 'Session Duration' column (which ranges from 0 to 1800 seconds) using min-max scaling so it falls between 0 and 1.

Extract new features from the timestamp: 'Hour of Day', 'Day of Week', 'Is Weekend'.

One-hot encode the 'Device Type' column (Mobile, Desktop, Tablet) into three binary columns.

After these transformations, they realise they need a more powerful feature. They hypothesise that a customer who viewed a product three times in the last hour is much more likely to buy than someone who viewed it once three weeks ago. So they engineer a new feature called 'Recent View Frequency' — a numeric count of product page views in the last 24 hours. They also create 'Average Session Value' by dividing total amount spent in past sessions by number of sessions. These engineered features are stored in SageMaker Feature Store under a feature group called 'customer_purchase_signals'.

Once the features are ready, the team uses SageMaker Processing to run a Python script that joins the transformed data with the stored features, splits the data into training and testing sets, and saves the processed data back to S3. This automated pipeline runs nightly so that the model always trains on fresh data. When a new customer visits the site, the inference pipeline retrieves their real-time features from the Feature Store and feeds them into the model for a prediction — all without the latency of recomputing the transformations from scratch. This stream of work is what an ML engineer or data scientist actually does in their day-to-day job.

How MLA-C01 Actually Tests This

The MLA-C01 exam tests this objective aggressively. Expect at least 5-10 questions directly on data transformation and feature engineering with SageMaker. The exam loves to test your ability to distinguish between the different SageMaker services and when to use each one. The most common question pattern is a scenario: 'A data scientist has a 500 GB dataset in S3. They need to perform feature engineering. Which service should they use?' The correct answer is usually SageMaker Processing (for custom scripts) or SageMaker Data Wrangler (for visual/no-code). A trap is to suggest Amazon EMR or AWS Glue, which are general big data tools; the exam wants you to choose the SageMaker-native option.

Another frequent trap involves the SageMaker Feature Store. The exam gives a scenario where a team is training the same model multiple times and each time the data scientist manually re-engineers the same features. The correct pattern is to recommend using the Feature Store to avoid duplication and ensure consistency between training and inference. The trap answer is to suggest a manual S3-based solution, which is inferior.

Key concepts the exam loves to test:

Difference between transformation (cleaning, scaling, encoding) and feature engineering (creating new variables).

The purpose of the Feature Store: store, share, and serve features with low latency for real-time inference.

The difference between offline mode (batch training) and online mode (real-time) in Feature Store.

That SageMaker Data Wrangler supports over 300 built-in transforms including handling missing values, text tokenisation, and time-series decomposition.

That SageMaker Processing can run both Python scripts (using Scikit-learn, Pandas) and Apache Spark scripts.

The importance of 'feature importance' — the exam may ask how to interpret feature importance from a SageMaker built-in model.

The exam also tests specific feature engineering techniques that are available as built-in transforms in SageMaker Data Wrangler. These include:

One-hot encoding, target encoding, label encoding.

Min-max normalisation, standardisation, robust scaling.

Date/time decomposition.

Text transformation using regular expressions, stemming, lemmatisation.

Grouping and aggregation.

A common trap question involves 'overfitting' caused by feature engineering. The exam might ask: 'A data scientist creates 200 new features. The model performs perfectly on training data but poorly on test data. What is the likely issue?' The answer is overfitting caused by too many engineered features, and the solution is feature selection or regularisation. Another trap: they might ask about 'leakage' — when a feature inadvertently contains information about the target value that would not be available at prediction time. For example, using 'future sales data' as a feature when predicting tomorrow's sales. The exam expects you to spot this.

Finally, memorise that SageMaker provides a 'built-in algorithm' called 'XGBoost' that handles missing values internally during training, but for other algorithms you must handle missing values during the transformation phase. This distinction appears in questions about algorithm selection and data preparation.

Key Takeaways

Data transformation converts raw, messy data into a clean, numerical format that machine learning models can process.

Feature engineering creates new predictive variables from existing data to improve model accuracy.

SageMaker Data Wrangler is a visual, no-code tool for exploring and transforming data without writing scripts.

SageMaker Feature Store lets you store, share, and serve features consistently across training and real-time inference.

One-hot encoding turns categorical text labels into binary columns and is a standard transformation for non-ordinal categories.

Min-max scaling normalises numeric data to a 0-1 range so that models do not prioritise larger-valued features.

SageMaker Processing executes custom transformation scripts (Python or Spark) on managed clusters at any scale.

Always apply the same transformation parameters (e.g., scaling min/max) to both training and inference data to avoid data leakage.

The exam distinguishes between transformation (cleaning, scaling) and feature engineering (creating new variables) as separate concepts.

Feature engineering is an iterative process, not a one-time task.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Data Transformation

Cleans and standardises existing data into a usable format.

Includes normalisation, imputation, encoding.

Essential but does not create new information.

Feature Engineering

Creates new variables from existing data.

Includes decomposing dates, calculating ratios.

Adds predictive power; more creative.

SageMaker Data Wrangler

No-code visual interface.

Best for exploration and prototyping.

Cannot run custom Python scripts.

SageMaker Processing

Script-based (Python or Spark).

Best for production-scale batch jobs.

Runs custom code on managed clusters.

Offline Mode (Feature Store)

For batch training jobs.

Stores large historical feature data.

Higher latency, lower cost.

Online Mode (Feature Store)

For real-time inference.

Stores latest feature values.

Low latency, higher cost.

Min-Max Normalisation

Scales data to a fixed range [0,1].

Sensitive to outliers.

Best when data has known bounds.

Standardisation (Z-score)

Centres data at mean 0 with std dev 1.

Less sensitive to outliers.

Best for normally distributed data.

One-Hot Encoding

Creates binary columns for each category.

No ordinal relationship implied.

Works for nominal categories.

Label Encoding

Assigns integer labels (e.g., 0,1,2).

Implies ordinal relationship (e.g., 0 < 1 < 2).

Works for ordinal categories.

Watch Out for These

Mistake

Data transformation and feature engineering are the same thing and can be done in any order.

Correct

Transformation is cleaning and normalising raw data into a usable format. Feature engineering is creating new predictive variables from that transformed data. Transformation must happen before feature engineering.

Beginners hear both terms in the same context and assume they are interchangeable. They are not; they are sequential stages in the data preparation pipeline.

Mistake

SageMaker Data Wrangler can be used for training machine learning models directly.

Correct

Data Wrangler is exclusively for data preparation (exploration, visualisation, transformation). It does not train models. Model training is done with SageMaker training jobs or the built-in algorithms.

The word 'wrangler' implies hands-on manipulation, but beginners often overestimate its scope because other no-code tools like AutoML do include training.

Mistake

You must write custom code for every data transformation in SageMaker.

Correct

SageMaker Data Wrangler provides over 300 built-in, no-code transformations. You only need custom code (via SageMaker Processing) for complex logic not covered by the built-ins.

People with zero IT background associate 'cloud' with 'coding' and assume they have to script everything. SageMaker is designed to reduce that barrier.

Mistake

The Feature Store is optional and only useful for large teams.

Correct

The Feature Store is valuable even for a single data scientist because it ensures consistency between training and inference data, and it prevents re-computation of features during real-time predictions.

Beginners think of it as a 'team collaboration tool' when it is primarily a consistency and performance tool.

Mistake

You can skip data transformation if you use a powerful model like XGBoost.

Correct

XGBoost handles missing values internally, but it still requires numerical inputs, so you must still encode categorical variables and normalise/standardise numeric features for optimal performance.

Learners hear that XGBoost is 'robust' and assume it can eat raw data. It can handle some mess but not all mess.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between SageMaker Data Wrangler and SageMaker Processing?

SageMaker Data Wrangler is a visual, no-code tool for exploring and transforming data interactively. SageMaker Processing is a script-based service for running data processing jobs at scale, often using the scripts exported from Data Wrangler.

Do I need to know Python to use SageMaker for data transformation?

Not necessarily. SageMaker Data Wrangler lets you perform most transformations using a visual interface without code. However, for custom logic or complex operations, you will need Python (or PySpark) via SageMaker Processing.

What is a feature store and why would I use it?

A feature store is a centralised repository for storing and managing engineered features. You use it to share features across teams, ensure consistency between training and inference, and reduce duplicate work.

How do I handle missing values in SageMaker Data Wrangler?

Data Wrangler provides built-in transformers for handling missing values, such as imputing with the median, mean, or mode, or dropping rows with missing values. You select the appropriate one from the visual interface.

What is the difference between min-max normalisation and standardisation?

Min-max normalisation scales data to a fixed range (typically 0 to 1) using the minimum and maximum values. Standardisation centres data around a mean of 0 with a standard deviation of 1. Use normalisation when you know the bounds; use standardisation for normally distributed data without fixed bounds.

Can SageMaker automatically engineer features for me?

SageMaker Data Wrangler includes built-in feature engineering transforms (e.g., date decomposition, text extraction) that you can apply manually. SageMaker Autopilot can also automatically engineer features during the model building process, but you usually have control over the steps.

What is one-hot encoding and why is it needed?

One-hot encoding converts a categorical variable (e.g., 'colour' with values red, blue, green) into multiple binary columns (colour_red, colour_blue, colour_green), each with a 0 or 1. It is needed because machine learning models require numerical input.

Terms Worth Knowing

Keep going

You've finished Data Transformation and Feature Engineering with SageMaker. Continue through the MLA-C01 study guide to build a complete picture of the exam.

Done with this chapter?