Data Science Data Cleaning and Preparation 3 — Questions and Answers
Question 1: The interquartile range (IQR) method is commonly used to detect:
- Outliers (Correct answer)
- Missing values
- Duplicates
- Encoding errors
Correct answer: Outliers
Values outside 1.5×IQR beyond the quartiles are flagged as outliers.
Question 2: Min-max scaling transforms a feature to which range by default?
- [0, 1] (Correct answer)
- [-1, 1]
- [0, 100]
- Mean 0, std 1
Correct answer: [0, 1]
Min-max scaling rescales values to the 0 to 1 range.
Question 3: Z-score standardization produces data with:
- Mean of 0 and standard deviation of 1 (Correct answer)
- Range of 0 to 1
- All positive integers
- No missing values
Correct answer: Mean of 0 and standard deviation of 1
Standardization centers data to mean 0 and unit standard deviation.
Question 4: Which encoding creates a separate binary column for each category value?
- One-hot encoding (Correct answer)
- Ordinal encoding
- Mean imputation
- Log transform
Correct answer: One-hot encoding
One-hot encoding generates one binary indicator column per category.
Question 5: Why scale features before training a k-nearest-neighbors model?
- Distance calculations are sensitive to feature magnitude (Correct answer)
- KNN cannot handle categorical labels
- Scaling removes missing values
- It increases the number of neighbors
Correct answer: Distance calculations are sensitive to feature magnitude
KNN uses distances, so unscaled large-magnitude features dominate.
Question 6: Applying a log transform to a right-skewed feature primarily aims to:
- Reduce skew and compress large values (Correct answer)
- Add missing values
- Convert text to numbers
- Remove duplicates
Correct answer: Reduce skew and compress large values
Log transforms compress large values and reduce right skew.
Question 7: Removing a data point with age = 250 from a human dataset is best described as:
- Handling an invalid/implausible value (Correct answer)
- Normalizing
- Encoding
- Sampling
Correct answer: Handling an invalid/implausible value
An impossible age is an invalid value to correct or remove.
The interquartile range (IQR) method is commonly used to detect: