DEA-C01 Question 390
Single answerYou are designing a data pipeline on AWS to process a large dataset stored in Amazon S3. To speed up your data processing job, you need to sample the dataset to perform exploratory data analysis and test your transformations before applying them to the entire dataset. Which of the following sampling techniques would be most suitable for this use case if you want to ensure every part of the dataset has a proportionate representation?
- A
Random sampling
- B
Stratified sampling
- C
Systematic sampling
- D
Reservoir sampling
Show answer and explanation
Correct answer: B
Explanation
Stratified sampling is the best choice when you need to ensure proportional representation of all parts of a dataset. By dividing the data into strata and sampling from each group proportionately, it guarantees that all relevant groups are considered, making it ideal for exploratory data analysis and testing transformations in the scenario described.
- A. Incorrect.
Random sampling selects data points randomly without considering specific characteristics of the data. While this is a simple and often effective method, it does not guarantee proportional representation of all parts of the dataset.
- B. Correct.
Stratified sampling divides the dataset into strata (distinct groups) and then samples proportionally from each group, ensuring that all parts of the dataset are represented. This is ideal for the given use case where proportional representation is required.
- C. Incorrect.
Systematic sampling selects data points at regular intervals (e.g., every nth item). While it is efficient, it does not guarantee proportional representation of all groups in a dataset, especially if the data is unevenly distributed.
- D. Incorrect.
Reservoir sampling is used for streaming datasets where the total size is unknown. It randomly selects a fixed number of items from the dataset, and while efficient, it does not ensure proportional representation.