You need to choose between logistic regression and XGBoost for a binary classification problem with severe class imbalance and nonlinear decision boundaries. Which approach best aligns to advanced evaluation and robust training under imbalance?
Answer
Use XGBoost with class imbalance handled via scale_pos_weight and optimize log loss with stratified validation; report PR-AUC in addition to ROC-AUC
Explanation
B uses an imbalance-aware objective (scale_pos_weight) and emphasizes appropriate metrics (log loss/PR-AUC) that better reflect performance under imbalance. ROC-AUC can look optimistic when positives are rare.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
A multi-class problem is evaluated with macro-averaged F1, and the model underperforms on minority classes. You want to improve minority-class recall without causing excessive precision loss. Which technique is most appropriate?
View question →
A team uses SageMaker pipelines to orchestrate training. They need reproducible runs with strict control over training data versions, code, and hyperparameters. What should they rely on as the strongest mechanism to guarantee this reproducibility?
View question →
For a streaming feature pipeline feeding a model, you observe that inference latency spikes when using a real-time feature retrieval call. Which design change is most likely to reduce latency while preserving data freshness?
View question →
A dataset includes sensitive attributes. You must prevent leakage of these attributes while still using them for training-time checks. Which approach best satisfies leakage prevention while enabling governance?
View question →
In the described scenario, which action most directly mitigates training-serving skew for a feature used in both offline training and real-time inference?
View question →
You trained a model with an imputation strategy for missing numeric values and saved preprocessing steps, but the inference pipeline later receives missingness patterns that differ significantly from training (e.g., new nullable fields). What is the most defensible response to maintain model quality?
View question →