AWS Certified AI PractitionerAI/ML and Generative AI FundamentalsMedium

A data scientist is preparing a dataset for an AI/ML model that will predict the probability of a customer clicking on an advertisement. The dataset includes features like 'Age', 'Income', and 'TimeSpentOnSite'. Which of the following data preparation steps is crucial for ensuring that features with different scales (e.g., Age in years, Income in thousands) do not disproportionately influence the model?

  1. AImputation
  2. BFeature scaling
  3. COne-hot encoding
  4. DTokenization
Show answer & explanation

Correct answer: B. Feature scaling

Feature scaling (e.g., standardization or normalization) is crucial when working with features that have different scales. It transforms the values of numerical features to a common range or distribution, preventing features with larger numerical values from dominating the learning process, especially for algorithms sensitive to feature magnitudes like gradient descent-based models or distance-based algorithms.

Why the other options are wrong

  • A. Imputation deals with missing values in the dataset, not with the scale of existing numerical features.
  • C. One-hot encoding converts categorical variables into numerical format, not for handling different numerical scales.
  • D. Tokenization is a text preprocessing step, breaking text into units, and is not relevant for numerical feature scaling.

Feature Scaling

Feature scaling is a data preprocessing technique used to standardize or normalize the range of independent variables or features of data. It prevents features with larger numerical ranges from dominating those with smaller ranges in the model's learning process.

  • Essential for algorithms sensitive to feature magnitudes (e.g., SVMs, K-NN, neural networks).
  • Common methods include standardization (Z-score normalization) and min-max scaling.
  • Ensures all features contribute proportionally to the model's objective function.

Memory trick: Clean, Transform, Scale: Prepare data right, make models bright.

More AI/ML and Generative AI Fundamentals questions