BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon Exam MLS-C01 Topic 3 Question 93 Discussion

Actual exam question for Amazon's MLS-C01 exam
Question #: 93
Topic #: 3
[All MLS-C01 Questions]

An ecommerce company has developed a XGBoost model in Amazon SageMaker to predict whether a customer will return a purchased item. The dataset is imbalanced. Only 5% of customers return items

A data scientist must find the hyperparameters to capture as many instances of returned items as possible. The company has a small budget for compute.

How should the data scientist meet these requirements MOST cost-effectively?

Show Suggested Answer Hide Answer
Suggested Answer: B

The best solution to meet the requirements is to tune the csv_weight hyperparameter and the scale_pos_weight hyperparameter by using automatic model tuning (AMT). Optimize on {''HyperParameterTuningJobObjective'': {''MetricName'': ''validation:f1'', ''Type'': ''Maximize''}}.

The csv_weight hyperparameter is used to specify the instance weights for the training data in CSV format. This can help handle imbalanced data by assigning higher weights to the minority class examples and lower weights to the majority class examples. The scale_pos_weight hyperparameter is used to control the balance of positive and negative weights. It is the ratio of the number of negative class examples to the number of positive class examples. Setting a higher value for this hyperparameter can increase the importance of the positive class and improve the recall. Both of these hyperparameters can help the XGBoost model capture as many instances of returned items as possible.

Automatic model tuning (AMT) is a feature of Amazon SageMaker that automates the process of finding the best hyperparameter values for a machine learning model. AMT uses Bayesian optimization to search the hyperparameter space and evaluate the model performance based on a predefined objective metric. The objective metric is the metric that AMT tries to optimize by adjusting the hyperparameter values. For imbalanced classification problems, accuracy is not a good objective metric, as it can be misleading and biased towards the majority class. A better objective metric is the F1 score, which is the harmonic mean of precision and recall. The F1 score can reflect the balance between precision and recall and is more suitable for imbalanced data. The F1 score ranges from 0 to 1, where 1 is the best possible value. Therefore, the type of the objective should be ''Maximize'' to achieve the highest F1 score.

By tuning the csv_weight and scale_pos_weight hyperparameters and optimizing on the F1 score, the data scientist can meet the requirements most cost-effectively. This solution requires tuning only two hyperparameters, which can reduce the computation time and cost compared to tuning all possible hyperparameters. This solution also uses the appropriate objective metric for imbalanced classification, which can improve the model performance and capture more instances of returned items.

References:

* XGBoost Hyperparameters

* Automatic Model Tuning

* How to Configure XGBoost for Imbalanced Classification

* Imbalanced Data


Contribute your Thoughts:

Solange
5 months ago
I'm curious to see how the data scientist handles this 'small budget for compute' constraint. Maybe they'll just throw a few pennies at the problem and hope for the best!
upvoted 0 times
Margart
4 months ago
I think option C sounds like the best approach to maximize capturing returned items while being cost-effective.
upvoted 0 times
...
Onita
4 months ago
C) Tune all possible hyperparameters by using automatic model tuning (AMT). Optimize on {"HyperParameterTuningJobObjective": {"MetricName": "validation:f1", "Type": "Maximize"}}
upvoted 0 times
...
Salome
5 months ago
A) Tune all possible hyperparameters by using automatic model tuning (AMT). Optimize on {"HyperParameterTuningJobObjective": {"MetricName": "validation:accuracy", "Type": "Maximize"}}
upvoted 0 times
...
...
Isabella
5 months ago
Definitely option B. Optimizing for F1 score is a smart move given the imbalanced dataset. And limiting the tuning to just two key hyperparameters keeps the costs down.
upvoted 0 times
...
Walton
5 months ago
Haha, I'd love to see the data scientist's face if they tried to minimize the F1 score. That's gotta be a typo in the options, right?
upvoted 0 times
...
Brittni
5 months ago
I think tuning just the csv_weight and scale_pos_weight hyperparameters is the most cost-effective approach. Optimizing for F1 score will help capture the most returned items without blowing the budget.
upvoted 0 times
Mariann
5 months ago
Let's go with option B then. It's a targeted approach that should give us the best results within our budget constraints.
upvoted 0 times
...
Maryln
5 months ago
I agree, focusing on those specific hyperparameters and optimizing for F1 score seems like the best cost-effective strategy.
upvoted 0 times
...
Bong
5 months ago
B) Tune the csv_weight hyperparameter and the scale_pos_weight hyperparameter by using automatic model tuning (AMT). Optimize on {"HyperParameterTuningJobObjective": {"MetricName": "validation:f1", "Type": "Maximize"}}.
upvoted 0 times
...
...

Save Cancel