Azure AutoML Hyperparameter Configuration | Exam DP-100 | Microsoft

Configure Hyperparameters for Azure AutoML | Exam DP-100 | Microsoft

Question

You are running experiments with Azure autoML service and you need to configure the model's hyperparameters.

You need to define the sampling space for two parameters and you want AutoML to use a sampling method which picks samples based on the result of previous runs, in order to improve the performance in the primary metric.

# define parameter space from azureml.train.hyperdrive import BayesianParameterSampling, normal, uniform my_parameter_space = { "learning_rate": normal(10, 2), "keep_probability": uniform(0.05, 0.1) } param_sampling = BayesianParameterSampling(my_parameter_space) ... 
Does the script above fulfills your requirement?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

Answer: B.

Option A is incorrect because the code defines the parameter search space for two parameters,learning_rate and keep_probability, with the Bayesian sampling method.

Bayesian sampling improves sampling based on the result of previous runs, but it cannot be used with ‘normal' distribution.

Option B is CORRECT because while the Bayesian parameter sampling is the right choice, this sampling method only supports choice, uniform, and quniform distributions.

Therefore, using ‘normal' is wrong in this case.

Reference:

The script above uses BayesianParameterSampling to define the sampling space for two hyperparameters: "learning_rate" and "keep_probability". The "normal" function is used to sample values for the "learning_rate" parameter, with a mean of 10 and standard deviation of 2. The "uniform" function is used to sample values for the "keep_probability" parameter, with a minimum value of 0.05 and maximum value of 0.1.

BayesianParameterSampling is a sampling method that uses previous experiment results to inform the next set of hyperparameters to try. It uses a probabilistic model to predict the performance of different hyperparameters, and then samples from the parameter space based on those predictions. This can be an effective way to explore the hyperparameter space and find good values, particularly when the search space is large or when there are complex interactions between hyperparameters.

Therefore, the script above fulfills the requirement of using a sampling method which picks samples based on the result of previous runs, in order to improve the performance in the primary metric. The BayesianParameterSampling method will use the results of previous experiments to inform the next set of hyperparameters to try, which should improve the performance of the model in the primary metric over time.

Thus, the correct answer is A. Yes.