AWS Certified Machine Learning - Specialty Exam: Hyperparameter Tuning for XGBoost Algorithm

Hyperparameter Tuning for XGBoost Algorithm

Question

You work as a machine learning specialist for a marketing firm.

Your firm wishes to determine which customers in a dataset of its registered users will respond to a new proposed marketing campaign.

You plan to use the XGBoost algorithm on the binary classification problem.

In order to find the optimal model, you plan to run many hyperparameter tuning jobs to reach the best hyperparameter values.

Which of the following hyperparameters must you use in your tuning jobs if your objective is set to multi:softprob? (Select TWO)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E. F.

Answers: D and F.

Option A is incorrect.

The alpha hyperparameter is used to adjust the L1 regulation term on weights.

This term is optional.

(See the Amazon SageMaker developer guide titled XGBoost Hyperparameters)

Option B is incorrect.

The base_score hyperparameter is used to set the initial prediction score of all instances.

This term is optional.

(See the Amazon SageMaker developer guide titled XGBoost Hyperparameters)

Option C is incorrect.

The eta hyperparameter is used to prevent overfitting.

This term is optional.

(See the Amazon SageMaker developer guide titled XGBoost Hyperparameters)

Option D is correct.

The num_round hyperparameter is used to set the number of rounds to run in your hyperparameter tuning jobs.

This term is required.

(See the Amazon SageMaker developer guide titled XGBoost Hyperparameters)

Option E is incorrect.

The gamma hyperparameter is used to set the minimum loss reduction required to make a further partition on a leaf node of the tree.

This term is optional.

(See the Amazon SageMaker developer guide titled XGBoost Hyperparameters)

Option F is correct.

This hyperparameter is used to set the number of classes.

This term is required if the objective is set to multi:softmax or multi:softprob.

(See the Amazon SageMaker developer guide titled XGBoost Hyperparameters)

Reference:

Please see the Amazon SageMaker developer guide titled Automatic Model Tuning and the Amazon SageMaker developer guide titled How Hyperparameter Tuning Works.

XGBoost is an efficient and effective algorithm used for machine learning tasks like classification, regression, and ranking. It is based on the gradient boosting decision tree method and can handle large datasets with high dimensionality.

When it comes to hyperparameter tuning, the objective parameter in XGBoost specifies the learning task and the corresponding evaluation metric to optimize. For example, if the objective is set to binary:logistic, it means the algorithm is trained to perform binary classification using logistic regression, and the evaluation metric is the logarithmic loss. Similarly, multi:softprob is used when there are multiple classes, and the algorithm outputs a probability distribution over all classes.

Now, let's look at the given options and select the hyperparameters that must be used in tuning jobs when the objective is set to multi:softprob:

A. alpha: This hyperparameter controls the L1 regularization term on the weights of the model. It is used to prevent overfitting and can be tuned based on the dataset. However, it is not specific to the multi:softprob objective.

B. base_score: This hyperparameter is the initial prediction score of all instances, which is used to calculate the final prediction. It is not specific to the multi:softprob objective.

C. eta: This hyperparameter controls the learning rate of the algorithm, which affects the step size at each boosting iteration. It can be used to avoid overfitting and improve convergence speed. It can be tuned for any objective, including multi:softprob.

D. num_round: This hyperparameter specifies the number of boosting rounds or iterations to perform. It can be tuned for any objective, including multi:softprob.

E. gamma: This hyperparameter controls the minimum loss reduction required to split a leaf node. It is used to prevent overfitting and can be tuned based on the dataset. However, it is not specific to the multi:softprob objective.

F. num_class: This hyperparameter specifies the number of classes in the dataset. It is required for the multi:softprob objective as it determines the size of the output probability distribution.

Therefore, the two hyperparameters that must be used in tuning jobs when the objective is set to multi:softprob are C. eta and F. num_class.