MLA-C01 Question 20
Single answerYou are designing a machine learning pipeline to process customer feedback data stored in an Amazon S3 bucket. The data includes JSON files containing nested structures with customer reviews, ratings, and timestamps. You want to preprocess this data for training a model in Amazon SageMaker. Which data format and ingestion mechanism would be most appropriate for this scenario?
- A
Convert the JSON data into CSV format and use Amazon SageMaker Pipe mode for ingestion.
- B
Normalize the JSON data into Parquet format and use Amazon SageMaker File mode for ingestion.
- C
Directly ingest the JSON data using Amazon SageMaker File mode without conversion.
- D
Convert the JSON data into RecordIO format and use Amazon SageMaker Pipe mode for ingestion.
Show answer and explanation
Correct answer: B
Explanation
JSON data with nested structures can be difficult to process directly, especially for machine learning workflows. Converting to Parquet format preserves the hierarchical nature of the data, improves storage efficiency, and facilitates preprocessing. Using Amazon SageMaker File mode allows the system to handle large-scale data stored in Amazon S3 efficiently, making this the best approach for the given scenario.
- A. Incorrect.
Converting JSON to CSV can flatten nested structures, potentially losing valuable hierarchical information. While Pipe mode is efficient, it may not be ideal for large JSON datasets without preprocessing.
- B. Correct.
Parquet is a columnar storage format that efficiently handles nested structures and is optimized for analytics and machine learning. File mode is suitable for reading large datasets from Amazon S3, making this the best choice.
- C. Incorrect.
Directly ingesting raw JSON data might work for small, simple datasets, but it is not efficient or scalable for complex, nested JSON structures used in machine learning workflows.
- D. Incorrect.
RecordIO is efficient for binary data, but converting JSON to RecordIO requires significant effort and is not ideal for handling nested structures. Pipe mode is also less commonly used with RecordIO for such scenarios.