Instiq
Chapter 1 · Data Engineering·v2.1.0·Updated 6/14/2026·~11 min

What's changed: In-scope coverage: added core service explanations

1.2Data Transformation and Feature Preparation

Key points

Shape data into usable form—understand Glue ETL, the data catalog, Data Wrangler, feature engineering, and the Feature Store. Good features drive model quality.

Raw data is not usable as-is. Shape it via cleaning, transformation, and feature engineering. On AWS, Glue and SageMaker Data Wrangler do this work.

1.2.1Transformation and features

Diagram of data transformation and preparation: raw data in S3 (messy, mixed types) is shaped by AWS Glue ETL (clean, join, dedup, schema in the data catalog, SageMaker Data Wrangler also usable) into features (encode, scale, impute, reuse via Feature Store, train/serve parity); good features matter more than fancy models.
Data transformation and preparation
  • Glue ETL: serverless cleaning/join/transform, with schema managed in the data catalog.
  • Data Wrangler: a SageMaker tool to prepare data and engineer features visually.
  • Feature engineering: improve quality via encoding (categorical→numeric), scaling, imputation.
  • Feature Store: store, share, and reuse features so training and inference use the same ones.
Exam point

Common on MLS-C01: serverless ETL/schema = Glue (data catalog), visual data prep = SageMaker Data Wrangler, store/share/reuse features = Feature Store, and same features for train and serve = train/serve parity. Good features strongly drive model accuracy.

MLS-C01 probes concrete feature-transformation techniques and data-quality handling. For categorical variables, use One-Hot for nominal (unordered) variables, target/frequency encoding or embeddings for high-cardinality ones to avoid dimensionality blow-up, and label encoding only for ordinal variables. Numeric handling is algorithm-dependent: distance/gradient-sensitive methods (linear/SVM/KNN/NN) need standardization (mean 0, var 1) or normalization (0–1), while tree methods (e.g., XGBoost) are scale-invariant and don’t. For missing values, beyond mean/median/mode imputation, adding a missingness flag column can make "being missing" informative. Apply log transforms to skewed distributions, binning (discretization) to continuous values, TF-IDF/Bag-of-Words/tokenization to text, and normalization/augmentation to images. Detect outliers with IQR or standard deviation and decide between removal and clipping. For class imbalance (e.g., fraud), use oversampling like SMOTE/undersampling/class weights, and evaluate with precision/recall/AUC rather than accuracy. Build these transforms visually in Data Wrangler, export to reproduce in a Processing Job or Pipelines, and store finalized features in Feature Store’s online (low-latency inference) / offline (training) stores to prevent train/serve skew.

Data/situationTypical transformNote
Nominal categorical (low cardinality)One-Hot encodingHigh cardinality blows up dims
High cardinalityTarget/frequency, embeddingsMind leakage (compute within CV)
Numerics with different scalesStandardize/normalizeTrees no; linear/NN yes
Class imbalanceSMOTE/class weightsUse precision/recall/AUC, not accuracy
Note

Scenario: in fraud detection only 0.5% are positives, so 99% accuracy just means predicting "normal" for everything—useless. → Address imbalance with oversampling (SMOTE) or class weights, and switch the metric from accuracy to precision/recall/F1/PR-AUC. Tune the threshold to business cost (e.g., miss cost > false-alarm cost).

Note

FAQ: Q. When is standardization needed? A. For distance/gradient-sensitive methods (linear/SVM/KNN/NN); not for tree methods like XGBoost. Q. Pitfall of target encoding? A. It uses the label, so it leaks easily—compute it per fold within cross-validation. Q. Features drift between train and prod? A. Share one definition via Feature Store’s online/offline stores to prevent train/serve skew.

Warning

Trap: "just normalize and impute over all data up front" is false. Using test-set statistics (mean/variance/mode) before training causes data leakage and optimistic evaluation. Fit scalers and imputers on the training data only, then apply that transform to test/production (freeze it in Pipelines).

1.2.2Section summary

  • Transform = Glue ETL (+ data catalog) / Data Wrangler
  • Features = engineering + reuse via Feature Store

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. Serverlessly clean/transform raw S3 data and manage schema in a catalog. What?

Q2. Reuse engineered features for both training and inference with consistency. What?

Q3. What is the work of encoding categoricals, scaling features, and imputing missing values called?

Check your understandingPractice questions for Chapter 1: Data Engineering