What's changed: In-scope coverage: added core service explanations
1.2Data Transformation and Feature Preparation
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
- 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.
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/situation | Typical transform | Note |
|---|---|---|
| Nominal categorical (low cardinality) | One-Hot encoding | High cardinality blows up dims |
| High cardinality | Target/frequency, embeddings | Mind leakage (compute within CV) |
| Numerics with different scales | Standardize/normalize | Trees no; linear/NN yes |
| Class imbalance | SMOTE/class weights | Use precision/recall/AUC, not accuracy |
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).
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.
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?

