MLS-C01 Question 182
Select 3You are training a machine learning model using Amazon SageMaker. The model's performance is highly sensitive to hyperparameter values like learning rate and batch size. To improve the model's performance, you decide to automate hyperparameter optimization. Which of the following steps should you take to effectively perform hyperparameter optimization in SageMaker?
- A
Define the hyperparameter ranges and the objective metric for optimization.
- B
Set up a SageMaker Hyperparameter Tuning Job by specifying the training job and search strategy.
- C
Manually train the model multiple times with different hyperparameter configurations to identify the optimal set.
- D
Use SageMaker's automatic model tuning feature to evaluate multiple hyperparameter combinations.
- E
Specify a random search strategy, as it is the only supported search strategy in SageMaker.
Show answer and explanation
Correct answers: A, B, D
Explanation
To perform hyperparameter optimization in SageMaker, you must define the hyperparameter ranges and objective metric, and set up a Hyperparameter Tuning Job, which automates the process of finding the best hyperparameters. SageMaker's automatic model tuning feature evaluates combinations of hyperparameters based on your defined ranges and the objective metric. While random search is one option, SageMaker also supports Bayesian optimization as a search strategy, making it more versatile.
- A. Correct.
Correct. Defining hyperparameter ranges and the objective metric is a critical first step to guide the tuning process in SageMaker.
- B. Correct.
Correct. A SageMaker Hyperparameter Tuning Job is required to automate hyperparameter optimization. You need to specify key details like the training job and the search strategy (e.g., Bayesian or random search).
- C. Incorrect.
Incorrect. Manually training the model with different hyperparameter combinations is inefficient and does not leverage SageMaker's automated tuning capabilities.
- D. Correct.
Correct. SageMaker's automatic model tuning feature is designed to evaluate and optimize hyperparameters over multiple configurations.
- E. Incorrect.
Incorrect. SageMaker supports both random search and Bayesian optimization strategies, not just random search.