Courseiva
Fundamentals of AI and MLmediumMultiple SelectObjective-mapped

Best Practices for Preprocessing Data in Machine Learning

Which TWO of the following are best practices for data preprocessing in machine learning? (Select TWO.)

Quick Answer

The answer is feature scaling for gradient-based algorithms and cross-validation to evaluate model performance. Feature scaling, such as normalization or standardization, is critical for gradient-based algorithms like linear regression or neural networks because these models rely on distance calculations and gradient descent; without scaling, features with larger magnitudes can dominate the learning process, leading to slow convergence or poor results. Cross-validation, on the other hand, provides a robust estimate of model generalization by repeatedly splitting data into training and validation sets, reducing the variance of a single train-test split and helping detect overfitting. On the AWS Certified AI Practitioner AIF-C01 exam, this question tests your understanding of foundational preprocessing steps that directly impact model accuracy and reliability, often appearing as a trap where candidates confuse data splitting with preprocessing or overlook scaling for tree-based models. Remember the mnemonic “Scale for Slope, Cross for Confidence” — scale your features when using gradient-based slopes, and cross-validate to build confidence in your model’s real-world performance.

⚠ Common exam trap

AWS often tests the misconception that one-hot encoding is universally applicable to all categorical data, but the trap here is that candidates forget ordinal categories have a natural order that one-hot encoding discards, leading to loss of information and potentially worse model performance.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use cross-validation to evaluate model performance

Cross-validation is a best practice for evaluating model performance because it provides a more robust estimate of how the model will generalize to unseen data by partitioning the data into multiple training and validation sets. This reduces the variance associated with a single train-test split and helps detect overfitting, making it a standard technique in machine learning workflows.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use cross-validation to evaluate model performance

    Why this is correct

    Cross-validation provides a more reliable estimate of model generalization.

  • Always split data 80/20 for training and testing

    Why it's wrong here

    The split ratio depends on dataset size; 80/20 is not always optimal.

  • One-hot encoding for ordinal categories

    Why it's wrong here

    Ordinal categories should use ordinal encoding; one-hot encoding ignores order.

  • Feature scaling for gradient-based algorithms

    Why this is correct

    Feature scaling ensures features contribute equally to the optimization.

  • Drop duplicate records only if they are manual entry errors

    Why it's wrong here

    Duplicates should generally be removed to avoid bias, not only manual errors.

About these practice questions

One of 619 original AIF-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on AIF-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which TWO of the following are best practices for preparing training data for a machine learning model?

hard
  • A.Handle missing values by imputing or removing them.
  • B.Split the data into training, validation, and test sets.
  • C.Remove all outliers to improve model robustness.
  • D.Use the entire dataset for training to maximize data usage.
  • E.Avoid shuffling the data to preserve original order.

Why A: Handling missing values is a critical data preprocessing step. Missing data can introduce bias or cause algorithms to fail. Imputation (e.g., using mean, median, or model-based methods) or removal of rows/columns with missing values ensures the dataset is complete and suitable for training, preventing errors during model fitting.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AIF-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AIF-C01 exam.