Imbalanced data is a common challenge in classification problems, where standard models tend to be biased toward majority classes, leading to poor detection of minority instances. This paper presents a comparative study of Light Gradient Boosting Machine (LightGBM) and eXtreme Gradient Boosting (XGBoost) models, enhanced with cost-sensitive learning to address class imbalance at the algorithmic level. The objective is to evaluate the impact of cost-sensitive loss adjustments on model performance using various evaluation metrics. Experimental results show that both models achieved high cross-validation and test accuracies, with LightGBM and XGBoost recording over 99.9% accuracy. However, only cost-sensitive LightGBM achieved perfect scores in precision, recall, and F1-score, indicating its ability to handle minority class identification effectively. In contrast, XGBoost exhibited lower recall and F1-score despite similar accuracy, reflecting limitations in sensitivity to minority instances. Models without cost-sensitive learning demonstrated further drops in performance across minority-related metrics. The findings suggest that cost-sensitive LightGBM is a more robust solution for imbalanced classification tasks, outperforming both its baseline and the cost-sensitive XGBoost variant. This approach is particularly beneficial for critical applications such as fraud detection, cybersecurity, and medical diagnostics, where class imbalance is prevalent and misclassification costs are high
Copyrights © 2025