Courseiva
Data Preparation for Machine LearningmediumMultiple ChoiceObjective-mapped

MLA-C01 Data Preparation for Machine Learning Practice Question

A healthcare company is developing a predictive model to identify patients at risk of readmission within 30 days after discharge. The dataset contains electronic health record (EHR) data from multiple hospitals, stored as Parquet files in Amazon S3. The data includes patient demographics, diagnoses (ICD-10 codes), medications, lab results, and length of stay. A data scientist notices that the 'lab_result' column has a high number of null values (over 60%) because some tests are not applicable to all patients. Additionally, the 'diagnosis_code' column has over 10,000 unique ICD-10 codes. The company wants to build a model that complies with HIPAA and performs well. The data scientist must prepare the features efficiently using AWS services. Which combination of steps should the data scientist take? (Assume the company can use any AWS service.)

⚠ Common exam trap

Many candidates choose simple mean imputation (Option B) or dropping rows (Option C) without considering the impact of high missingness on bias and data loss, or they overcomplicate encoding (Option D) without recognizing that ordinal encoding implies a false order for categorical codes.

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 AWS Glue ETL to impute missing lab results with a value predicted from other features using a model like XGBoost, and apply count encoding to diagnosis codes based on their frequency of occurrence.

It uses AWS Glue ETL to impute missing lab results with a predictive model (XGBoost), which is appropriate for high missingness (>60%) where simple imputation would bias the model, and applies count encoding to the high-cardinality diagnosis codes (10,000+ unique values) to avoid the dimensionality explosion of one-hot encoding while preserving frequency information. This approach balances HIPAA compliance (data stays within AWS) with model performance.

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 AWS Glue ETL to impute missing lab results with a value predicted from other features using a model like XGBoost, and apply count encoding to diagnosis codes based on their frequency of occurrence.

    Why this is correct

    Predictive imputation leverages other features to estimate missing values, retaining data. Count encoding reduces the cardinality of diagnosis codes.

  • Replace missing lab results with the overall mean, and use a binary flag for nullness. For diagnosis codes, apply one-hot encoding after grouping codes into 20 categories based on clinical relevance.

    Why it's wrong here

    Replacing 60% null lab results with the overall mean distorts the distribution and introduces bias, as missingness is not random—tests are omitted based on clinical indication. Grouping 10,000 ICD-10 codes into only 20 categories loses granular diagnostic information critical for readmission risk. This approach is tempting because mean imputation is a simple, fast baseline for missing numeric data, and category grouping reduces dimensionality for models that cannot handle high-cardinality features, such as linear classifiers.

  • Drop all records where lab_result is null, and use one-hot encoding for diagnosis codes.

    Why it's wrong here

    Dropping 60% of records reduces the dataset size greatly and can introduce selection bias. One-hot encoding 10,000 codes is not feasible.

  • Use Amazon SageMaker Data Wrangler's built-in 'Fill missing' with KNN imputation for lab results, and apply ordinal encoding to diagnosis codes based on the order of ICD-10 chapters.

    Why it's wrong here

    KNN imputation on 60% missing data is computationally intensive and assumes local similarity; ordinal encoding by chapter may not be meaningful for model performance.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

This MLA-C01 question is part of Courseiva's 835-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This MLA-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 MLA-C01 exam.