Based on the MLS-C01 exam guideReport an error
Over the past three days, we've covered data cleaning and feature engineering at the concept and code level. Today we look at three SageMaker services that perform the same work on AWS at scale, reproducibly, and for reuse.
Data Wrangler is a visual data preparation tool within SageMaker Studio. With almost no code, you apply 300+ built-in transformations — missing-value imputation, encoding, scaling, outlier handling, and more — by clicking.
Key capabilities:
[Data Wrangler flow example]
S3 import → Impute missing (median) → One-Hot encode categorical
→ Standardize numeric → Data quality report
→ Export to: Processing Job / Feature Store / PipelineData Wrangler's value is "bridging exploration and production." Preprocessing that a data scientist improvises in a notebook is hard to reproduce and automate. Data Wrangler saves visually defined transformations as a declarative flow definition and exports it directly as a Processing Job or Pipeline step to fold it into the production pipeline. In other words, it guarantees "transformation built in exploration = transformation run in production," reducing preprocessing mismatches between training and inference. The key is to understand it not as something to dismiss as no-code, but as a tool for reproducibility and consistency.
⚠️ Pitfall: Data Wrangler shines at the exploration and preparation stage, but if you need petabyte-scale distributed processing or fully custom logic, EMR/Glue or a hand-written Processing Job is more suitable. In exams, "no-code / visual / quick EDA" leans toward Data Wrangler, and "large-scale custom-code batch processing" leans toward Processing Job.
Processing Job is a managed distributed compute job for preprocessing, postprocessing, and model evaluation. You package code in a container and run it on a cluster, and the infrastructure shuts down automatically when it finishes.
| Component | Description |
|---|---|
| Input | S3 (or another source) → downloaded to a local path in the container |
| Processing code | scikit-learn, Spark, or a custom container |
| Output | Results go from a container path → uploaded to S3 |
| Instances | Distributed across the specified type and count, auto-terminated after the job |
Common processors: SKLearnProcessor (scikit-learn), PySparkProcessor (large-scale Spark), custom containers.
from sagemaker.sklearn.processing import SKLearnProcessor
from sagemaker.processing import ProcessingInput, ProcessingOutput
processor = SKLearnProcessor(
framework_version="1.2-1",
role=role,
instance_type="ml.m5.xlarge",
instance_count=2, # distributed processing
)
processor.run(
code="preprocess.py",
inputs=[ProcessingInput(source="s3://bucket/raw/", destination="/opt/ml/processing/input")],
outputs=[ProcessingOutput(source="/opt/ml/processing/output", destination="s3://bucket/processed/")],
)[Processing Job execution flow]
S3 input ──download──▶ /opt/ml/processing/input
▼
run preprocess.py (distributed across N instances)
▼
/opt/ml/processing/output ──upload──▶ S3 output
▼
instances terminate automatically (billed only for what is used)
Processing Job is the ML preprocessing implementation of the "separate compute and storage" philosophy. Data stays in S3; instances are launched only when the job runs, follow the S3 → local → process → S3 pattern, and then shut down. So you are billed only for what you use, and the job enters the same SageMaker tracking and logging framework (CloudWatch, Experiments) as training jobs. It overlaps with EMR/Glue in places, but Processing Job's strengths are its integration with SageMaker workflows (especially Pipelines) and its ML-friendly container ecosystem.
| Tool | Interface | Scale | Strengths |
|---|---|---|---|
| Data Wrangler | Visual (no-code) | Medium | Quick EDA, quality reports, flow export |
| Processing Job | Code (container) | Large | Custom logic, SageMaker integration |
| Glue ETL / EMR | Code (Spark) | Very large | Shared ETL across the whole data lake |
Feature Store is a central repository to store, retrieve, share, and reuse machine learning features. It lets multiple teams and models use the same features consistently.
Problems it solves:
Two stores:
| Store | Use | Characteristics |
|---|---|---|
| Online Store | Low-latency lookup during real-time inference | Millisecond single-record lookup |
| Offline Store | Bulk lookup for training | S3-based, keeps historical records |
from sagemaker.feature_store.feature_group import FeatureGroup
fg = FeatureGroup(name="customer-features", sagemaker_session=session)
fg.load_feature_definitions(data_frame=features_df)
fg.create(
s3_uri="s3://bucket/feature-store/",
record_identifier_name="customer_id",
event_time_feature_name="event_time", # core for point-in-time accuracy
enable_online_store=True, # online + offline at the same time
)
# Retrieve latest features from the online store during inference
fg.get_record(record_identifier_value_as_string="C12345")[What a point-in-time lookup prevents]
Prediction time: 6/10 Value that must not enter the training set
│ │
▼ ▼
──●──────────────────────────────────────────●──▶ time
6/10 feature value (knowable) 6/20 feature value (future)
Record event_time → fetch only "values that were valid as of 6/10" → leakage blocked
Feature Store's core value is eliminating training-serving skew. A common accident is that the feature computed in batch at training time and the feature computed in real time at inference time are defined subtly differently, so model performance drops in production. Sharing the same feature definition across both Offline (training) and Online (inference) removes this mismatch. It also records event_time to support point-in-time lookups, a mechanism that builds the training set only from "values actually knowable at prediction time" and so blocks future-information leakage.
⚠️ Pitfall: Don't confuse the purposes of Feature Store's two stores. Real-time, low-latency single-record lookup is the Online Store; building a training set from large amounts of historical data is the Offline Store. If the keyword is "millisecond single-record inference lookup," Online is the answer.
Data preparation is not only "changing the shape." Diagnosing the bias already in the data is also part of this stage.
Bias problems are often solved not by changing the model but by looking at the data first. If a group has few samples to begin with, no amount of changing the algorithm will raise that group's performance.
How will you prepare the data?
├─ Visually with almost no code, with quality diagnosis too → Data Wrangler
├─ Large-scale distributed processing with custom code, auto-shutdown when done → Processing Job
├─ Shared cleansing across the whole data lake (many consumers) → Glue ETL / EMR
└─ Built features must be reused by several teams/models
and training/inference definitions must match → Feature Store
[Typical pipeline]
Data Wrangler (visual EDA and transformation definition)
│ export
▼
Processing Job (execute large-scale transformations)
│ ingest
▼
Feature Store (store and share features)
├─ Offline → training jobs
└─ Online → real-time inferenceThe three tools have different roles. Data Wrangler is for visual, no-code EDA and transformation definition; Processing Job is code-based large-scale distributed preprocessing; Feature Store guarantees feature reuse, training/inference consistency, and point-in-time accuracy. The three are often chained in one pipeline.
Adopting Feature Store when there is no reuse requirement only adds operational complexity. In exams too, if reuse, consistency, or point-in-time accuracy is not mentioned in the requirements, Feature Store may not be the correct answer.
In the next note we do a comprehensive review of all of Week 3 (cleaning, feature engineering, tools).
Click a choice to reveal the answer and explanation.
Question 1
You want to visually apply missing value imputation, encoding, and scaling with almost no code and automatically diagnose data quality. Which SageMaker tool is MOST appropriate?
Question 2
You want to prevent training-serving skew, where the definition of features computed at training time differs from that computed at inference time and degrades production performance. Which service is MOST appropriate?
Question 3
You want to preprocess several terabytes of data in a distributed manner with custom PySpark code, store the results in S3, and have the infrastructure shut down automatically when the job finishes. Which is MOST appropriate?
Question 4
In Feature Store, a single record must be retrieved within milliseconds for real-time inference. Which store should you use?
Question 5
Which Feature Store capability prevents future-information leakage by "building the training set only from values that were actually knowable at prediction time"?