AWS Certified Machine Learning Engineer Associate · Free Practice Question Medium
Question 10
A financial services company is building an automated pipeline to update its fraud detection ML model every week using Amazon SageMaker Pipelines. The pipeline will consist of the following steps:
A data preprocessing step to clean and transform transactional data.
A model training step to build the fraud detection model.
An evaluation step to calculate accuracy and other metrics.
A model registration step to store the new model in the SageMaker Model Registry.
The preprocessing step involves large-scale data transformations and joins across multiple datasets stored in Amazon S3. The data transformations currently run on a distributed Amazon EMR cluster. The data science team wants to integrate these transformations into the SageMaker Pipelines workflow seamlessly.
Which options should be combined for a solution that addresses these requirements? (Select two)
-
A
Set up an Amazon EMR job as the first step of the ML workflow orchestrated by AWS Step Functions
-
B
Set up an Amazon EMR job as a callback step of the SageMaker Pipelines workflow
-
C
Set up an Amazon EMR job as the processing step of the SageMaker Pipelines workflow
-
D
Swap out the SageMaker Pipeline with AWS Step Functions as the ML workflow orchestration service
-
E
Add a policy to the SageMaker Pipelines execution role to allow the role to invoke an Amazon EMR job flow
Reveal correct answers
Correct answers: B, E
Explanation
Correct options:
Set up an Amazon EMR job as a callback step of the SageMaker Pipelines workflow
A callback step allows you to integrate any task or job outside Amazon SageMaker as a step in the model building pipeline. When a callback step is invoked, the current execution of a SageMaker model building pipeline will pause and wait for an external task or job to return a task token that was generated by SageMaker at the start of call back step execution. You can use the call back step to include processing jobs external to SageMaker such a Spark job running on an Amazon EMR cluster or an extract-transform-load (ETL) task in AWS Glue as part of the SageMaker model building pipeline.
Add a policy to the SageMaker Pipelines execution role to allow the role to invoke an Amazon EMR job flow
The AmazonSageMakerPipelinesIntegrations managed policy grants permissions commonly needed to use Callback steps and Lambda steps in SageMaker Pipelines workflow. The policy can be attached to any role used for authoring or executing a pipeline. This policy grants appropriate IAM permissions needed when building pipelines that include callback steps which can be used for manual approval steps or running custom workloads.
Incorrect options:
Set up an Amazon EMR job as the first step of the ML workflow orchestrated by AWS Step Functions
Swap out the SageMaker Pipeline with AWS Step Functions as the ML workflow orchestration service
Swapping out SageMaker Pipelines workflow with AWS Step Functions offers no real advantage for the given use case. Rather, SageMaker Pipelines workflow is better suited for SageMaker specific ML operations due to the tighter integrations with the various SageMaker tools. So, both these options are incorrect.
Set up an Amazon EMR job as the processing step of the SageMaker Pipelines workflow - A processing step is designed for running data processing or feature engineering tasks within SageMaker using managed infrastructure. It leverages SageMaker Processing Jobs, where you can execute custom Python scripts or prebuilt containers for tasks like data transformation, cleaning, or validation. For the given use case, you need to set up Amazon EMR job as a callback step of the SageMaker Pipelines workflow.
References:
https://aws.amazon.com/about-aws/whats-new/2022/01/amazon-sagemaker-pipelines-emr-integration/
https://docs.aws.amazon.com/sagemaker/latest/dg/security-iam-awsmanpol-pipelines.html
https://docs.aws.amazon.com/sagemaker/latest/dg/build-and-manage-steps.html
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
