MLS-C01 Question 76
Select 3You are building a natural language processing (NLP) pipeline using Amazon SageMaker and have encountered issues with inconsistent data quality. The dataset contains missing values in some columns, corrupted numerical values, and text fields with excessive stop words. Which steps should you take to preprocess the data effectively before training your model?
- A
Replace missing values with mean or median for numerical columns and a placeholder value for categorical columns.
- B
Drop rows with missing values to avoid introducing bias into the model.
- C
Remove stop words from the text fields to reduce noise in the dataset.
- D
Use Amazon SageMaker Data Wrangler to identify and fix corrupted numerical values.
- E
Replace corrupted numerical values with random values to maintain dataset size.
Show answer and explanation
Correct answers: A, C, D
Explanation
Handling missing data, stop words, and corrupted values is key to preparing high-quality datasets for machine learning. Replacing missing values with statistical measures, removing stop words, and leveraging tools like Amazon SageMaker Data Wrangler for data cleaning are best practices that ensure the dataset is ready for training. Dropping rows unnecessarily or introducing random data can lead to bias and poor model performance.
- A. Correct.
Replacing missing values with mean or median for numerical columns and a placeholder for categorical columns is a common and effective preprocessing step to handle missing data without reducing dataset size.
- B. Incorrect.
Dropping rows with missing values can lead to loss of valuable data and is generally not preferred unless the dataset is large and the missing data is minimal.
- C. Correct.
Removing stop words reduces noise in text data, leading to better feature extraction and model performance in NLP tasks.
- D. Correct.
Amazon SageMaker Data Wrangler is a powerful tool for identifying and fixing data quality issues, including corrupted numerical values.
- E. Incorrect.
Replacing corrupted numerical values with random values is not recommended as it introduces noise and may lead to unreliable model predictions.