MLS-C01 Question 183
Select 2You are building a machine learning model using Amazon SageMaker and need to optimize the hyperparameters to improve the model's performance. The dataset is large, and training the model is computationally expensive. Which of the following approaches should you take to efficiently perform hyperparameter optimization while minimizing costs?
- A
Use SageMaker Automatic Model Tuning with Bayesian optimization to search for the best hyperparameters.
- B
Manually test a small subset of hyperparameters using trial and error on a local machine.
- C
Leverage SageMaker Automatic Model Tuning with a random search strategy to identify optimal hyperparameters.
- D
Use Amazon SageMaker Spot Instances to reduce the cost of training jobs during hyperparameter optimization.
- E
Set up a SageMaker Processing Job to automatically run all possible hyperparameter combinations exhaustively.
Show answer and explanation
Correct answers: A, D
Explanation
To efficiently perform hyperparameter optimization while minimizing costs, you should use SageMaker Automatic Model Tuning with Bayesian optimization, which iteratively learns the optimal hyperparameters without exhaustively testing all combinations. Additionally, using SageMaker Spot Instances reduces the cost of training jobs during the optimization process. These approaches balance computational efficiency and cost-effectiveness.
- A. Correct.
This is correct. SageMaker Automatic Model Tuning with Bayesian optimization is an efficient way to find the best set of hyperparameters by iteratively learning from previous training results, reducing the computational cost compared to exhaustive search.
- B. Incorrect.
This is incorrect. Manually testing hyperparameters is inefficient, especially for large datasets and computationally expensive models, and does not leverage automated optimization techniques provided by SageMaker.
- C. Incorrect.
This is incorrect. While random search is simpler and faster than exhaustive search, it is not as efficient as Bayesian optimization for hyperparameter optimization in terms of finding optimal solutions.
- D. Correct.
This is correct. Using Amazon SageMaker Spot Instances can significantly reduce the cost of training jobs during hyperparameter optimization, as Spot Instances are typically cheaper than On-Demand Instances.
- E. Incorrect.
This is incorrect. Running all possible hyperparameter combinations exhaustively is computationally expensive and infeasible for large datasets or models with many hyperparameters. SageMaker Automatic Model Tuning provides a more efficient alternative.