nerdexam
Amazon

MLA-C01 · Question #238

An ML engineer has developed a custom scikit-learn script to transform tabular data to train a regression model. The ML engineer wants to use Amazon SageMaker AI to prepare data and to train and…

The correct answer is B. Use the SKLearnProcessor class within the SageMaker Python SDK to run the custom script. The SKLearnProcessor class in the SageMaker Python SDK is purpose-built to run custom scikit-learn scripts as SageMaker Processing jobs. It handles the container environment, dependency management, and integration with SageMaker's data and training pipeline natively. This lets…

Data Preparation for Machine Learning

Question

An ML engineer has developed a custom scikit-learn script to transform tabular data to train a regression model. The ML engineer wants to use Amazon SageMaker AI to prepare data and to train and evaluate the model. Which solution will meet these requirements?

Options

  • ACreate an AWS Lambda function to run the custom script. Load the processed data into
  • BUse the SKLearnProcessor class within the SageMaker Python SDK to run the custom script.
  • CApply the HuggingFaceProcessor class within the SageMaker Python SDK to run the custom
  • DUse AWS Glue ETL custom recipes to perform data transformations. Load the processed data

How the community answered

(20 responses)
  • A
    15% (3)
  • B
    75% (15)
  • C
    5% (1)
  • D
    5% (1)

Explanation

The SKLearnProcessor class in the SageMaker Python SDK is purpose-built to run custom scikit-learn scripts as SageMaker Processing jobs. It handles the container environment, dependency management, and integration with SageMaker's data and training pipeline natively. This lets the ML engineer reuse their existing scikit-learn script without rewriting it.

Why the other options are wrong:

  • A: AWS Lambda has strict execution limits (15-minute timeout, 10 GB memory) and is not designed for ML data preprocessing workloads. It also does not integrate natively with SageMaker's training pipeline.
  • C: HuggingFaceProcessor is designed for HuggingFace-based NLP/ML frameworks, not scikit-learn. Using it for a scikit-learn script would require unnecessary workarounds.
  • D: AWS Glue ETL is a general-purpose data integration service. While it can transform data, it does not natively support scikit-learn scripts and is not part of the SageMaker processing framework, adding unnecessary complexity.

Topics

#SageMaker Processing#Scikit-learn#Data Transformation#SageMaker Python SDK

Community Discussion

No community discussion yet for this question.

Full MLA-C01 Practice