MLS-C01 · Question #88
A Machine Learning Specialist previously trained a logistic regression model using scikit-learn on a local machine, and the Specialist now wants to deploy it to production for inference only. What…
The correct answer is A. Build the Docker image with the inference code. To deploy a locally trained scikit-learn model to Amazon SageMaker for inference, you must bring your own container (BYOC). This requires building a Docker image that includes your inference code (a serving script that loads the model and handles prediction requests). SageMaker…
Question
A Machine Learning Specialist previously trained a logistic regression model using scikit-learn on a local machine, and the Specialist now wants to deploy it to production for inference only. What steps should be taken to ensure Amazon SageMaker can host a model that was trained locally?
Options
- ABuild the Docker image with the inference code.
- BSerialize the trained model so the format is compressed for deployment.
- CSerialize the trained model so the format is compressed for deployment.
- DBuild the Docker image with the inference code.
How the community answered
(47 responses)- A70% (33)
- B4% (2)
- C9% (4)
- D17% (8)
Explanation
To deploy a locally trained scikit-learn model to Amazon SageMaker for inference, you must bring your own container (BYOC). This requires building a Docker image that includes your inference code (a serving script that loads the model and handles prediction requests). SageMaker expects a specific container interface - the container must respond to /ping and /invocations HTTP endpoints. You also need to serialize the model (e.g., via joblib or pickle), upload the artifact to S3, and register a SageMaker Model pointing to both the Docker image and the S3 artifact. The question's options A and D are identical, as are B and C - a formatting artifact. The key step distinguishing deployment readiness is building the Docker image with inference code, because SageMaker cannot natively run a raw scikit-learn model object without a properly configured serving container.
Topics
Community Discussion
No community discussion yet for this question.