A data scientist is training a multilayer perceptron (MLP) for a multiclass problem. One class is rare and the model's recall for that class is unacceptably low. The scientist has already adjusted the number and size of hidden layers without meaningful improvement and needs a quick solution to raise recall. Which approach should be used?
Choose an answer
Tap an option to check your answer.
Correct answer: Add class weights to the MLP loss function and retrain.
Why this is the answer
Adding class weights to the MLP loss function is the most effective and quickest solution. This technique assigns a higher penalty to misclassifications of the rare class, forcing the model to pay more attention to it during training. This directly addresses the low recall for the minority class without requiring significant architectural changes or new data collection. Collecting more labeled examples (via Mechanical Turk or otherwise) is a good long-term strategy but is not a quick solution. Replacing the MLP with an anomaly detection model is inappropriate as this is a multiclass classification problem, not an anomaly detection task. Replacing the MLP with an XGBoost model might improve performance but doesn't directly address the class imbalance issue as efficiently as class weighting, and it would require retraining a completely different model.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed