DEA-C01 Question 394
Single answerYou are working on a data engineering project where you need to train a machine learning model on a large dataset stored in Amazon S3. Due to computational constraints, you decide to use a data sampling technique to create a representative subset of the data. Which of the following sampling techniques would be most appropriate if your dataset has an imbalanced distribution of target classes, and you want to ensure that the subset preserves the same class distribution as the original dataset?
- A
Random Sampling
- B
Stratified Sampling
- C
Systematic Sampling
- D
Cluster Sampling
Show answer and explanation
Correct answer: B
Explanation
Stratified Sampling is the most suitable technique when dealing with imbalanced datasets where the target variable's class distribution is important. By dividing the dataset into strata based on the target class and sampling proportionally from each stratum, this method ensures that the sample accurately reflects the original data's class distribution. Other techniques, such as Random Sampling or Systematic Sampling, do not account for class imbalance and may produce biased samples.
- A. Incorrect.
Random Sampling selects data points randomly from the dataset without considering class distribution. This approach may not preserve the imbalance in the target class distribution, making it unsuitable in this scenario.
- B. Correct.
Stratified Sampling ensures that the sample preserves the same class distribution as the original dataset. This makes it the most appropriate technique for handling imbalanced datasets.
- C. Incorrect.
Systematic Sampling selects data points at regular intervals from the dataset. It does not account for class distribution and may result in a non-representative sample in the case of imbalanced data.
- D. Incorrect.
Cluster Sampling divides the data into clusters and selects entire clusters for sampling. This method does not guarantee that the class distribution in the sample matches the original dataset's distribution.