Stacking Ensemble with SMOTE for Robust Agricultural Commodity Price Prediction under Imbalanced Data

Yessica Siagian, Jeperson Hutahaean, Neni Mulyani

Abstract


The volatility of agricultural commodity prices presents a substantial obstacle in the agribusiness sector, especially in supporting timely and data-driven decision-making. This volatility is primarily caused by the imbalanced distribution of historical price data and the complex, often nonlinear nature of price patterns. To address this challenge, this study proposes a novel predictive modeling approach by integrating Stacking Ensemble Learning and Synthetic Minority Over-sampling Technique (SMOTE). The dataset used in this research consists of 5,558 records and 9 features, sourced from a publicly available Kaggle dataset. The target variable daily price was transformed into three classes: low, medium, and high, using a quartile-based discretization approach to enable multiclass classification. The main objective is to evaluate whether stacking combined with SMOTE can improve model performance compared to baseline models that use individual algorithms. A total of eight models were constructed and compared: four baseline models using SMOTE only, and four stacking models integrating SMOTE. The experimental results demonstrate that the proposed model Decision Tree Regression with Stacking and SMOTE achieved the highest performance, with 98.68% accuracy, an F1-score of 0.9868, Cohen’s Kappa of 0.9803, MCC of 0.9803, ROC-AUC of 0.9995, and a log loss of 0.0529. Other optimized models also performed well, such as Random Forest (98.37% accuracy) and Gradient Boosting (98.56%). In contrast, baseline models such as Linear Regression and Decision Tree without stacking achieved only around 67–68% accuracy, with log loss exceeding 0.97. The key contribution of this study is the empirical evidence that combining stacking and SMOTE significantly enhances classification accuracy and model robustness in imbalanced datasets. The novelty lies in applying a deep learning-optimized stacking framework specifically for agricultural commodity price classification, along with a comprehensive multiclass evaluation, offering new insights for practical implementation in agricultural decision support systems.


Keywords


Agricultural Price Forecasting; Ensemble Machine Learning; Imbalanced Data Handling; Synthetic Oversampling (SMOTE); Stacking Ensemble Regression

Full Text:

PDF

References


Y. Chen, “Measuring green total factor productivity of China’s agricultural sector: A three-stage SBM-DEA model with non-point source pollution and CO2 emissions,” J. Clean. Prod., vol. 318, 2021, doi: 10.1016/j.jclepro.2021.128543.

F. Haque, “From waste to value: Addressing the relevance of waste recovery to agricultural sector in line with circular economy,” J. Clean. Prod., vol. 415, 2023, doi: 10.1016/j.jclepro.2023.137873.

J. Zeng, “Ecoefficiency of China’s agricultural sector: What are the spatiotemporal characteristics and how are they determined?,” J. Clean. Prod., vol. 325, 2021, doi: 10.1016/j.jclepro.2021.129346.

S. Xu, “Impact of the Regional Comprehensive Economic Partnership (RCEP) implementation on agricultural sector in regional countries: A global value chain perspective,” J. Integr. Agric., vol. 24, no. 1, pp. 380–397, 2025, doi: 10.1016/j.jia.2024.11.035.

L. Winder, “Wellbeing education increases skills and knowledge among tertiary students in the agricultural sector: insights from a mixed methods study,” J. Agric. Educ. Ext., vol. 31, no. 2, pp. 180–196, 2025, doi: 10.1080/1389224X.2024.2351545.

J. Wang, “Artificial bee colony-based combination approach to forecasting agricultural commodity prices,” Int. J. Forecast., vol. 38, no. 1, pp. 21–34, 2022, doi: 10.1016/j.ijforecast.2019.08.006.

M. R.L, “Market efficiency and price risk management of agricultural commodity prices in India,” J. Model. Manag., vol. 18, no. 1, pp. 190–211, 2023, doi: 10.1108/JM2-04-2021-0104.

K. K. Gokmenoglu, “Revisiting the linkage between oil and agricultural commodity prices: Panel evidence from an Agrarian state,” Int. J. Financ. Econ., vol. 26, no. 4, pp. 5610–5620, 2021, doi: 10.1002/ijfe.2083.

M. Bonato, “El Niño, La Niña, and forecastability of the realized variance of agricultural commodity prices: Evidence from a machine learning approach,” J. Forecast., vol. 42, no. 4, pp. 785–801, 2023, doi: 10.1002/for.2914.

A. Abduvasikov, “The concept of production resources in agricultural sector and their classification in the case of Uzbekistan,” Casp. J. Environ. Sci., vol. 22, no. 2, pp. 477–488, 2024, doi: 10.22124/cjes.2024.7740.

S. Hou, “Real-time prediction of rock mass classification based on TBM operation big data and stacking technique of ensemble learning,” J. Rock Mech. Geotech. Eng., vol. 14, no. 1, pp. 123–143, 2022, doi: 10.1016/j.jrmge.2021.05.004.

T. Yan, “Prediction of geological characteristics from shield operational parameters by integrating grid search and K-fold cross validation into stacking classification algorithm,” J. Rock Mech. Geotech. Eng., vol. 14, no. 4, pp. 1292–1303, 2022, doi: 10.1016/j.jrmge.2022.03.002.

T. Kavzoglu, “Predictive Performances of Ensemble Machine Learning Algorithms in Landslide Susceptibility Mapping Using Random Forest, Extreme Gradient Boosting (XGBoost) and Natural Gradient Boosting (NGBoost),” Arab. J. Sci. Eng., vol. 47, no. 6, pp. 7367–7385, 2022, doi: 10.1007/s13369-022-06560-8.

H. Wang, “Research on the Application of Random Forest-based Feature Selection Algorithm in Data Mining Experiments,” Int. J. Adv. Comput. Sci. Appl., vol. 14, no. 10, pp. 505–518, 2023, doi: 10.14569/IJACSA.2023.0141054.

S. Pande, A. Khamparia, and D. Gupta, “Feature selection and comparison of classification algorithms for wireless sensor networks,” J. Ambient Intell. Humaniz. Comput., vol. 14, no. 3, pp. 1977–1989, 2023, doi: 10.1007/s12652-021-03411-6.

P. R. Shekar, A. Mathew, and K. V. Sharma, “A hybrid CNN–RNN model for rainfall–runoff modeling in the Potteruvagu watershed of India,” CLEAN – Soil, Air, Water, vol. n/a, no. n/a, p. 2300341, 2024, doi: https://doi.org/10.1002/clen.202300341.

I. R. Munthe, B. H. Rambe, F. Hanum, A. T. Amanda, A. S. R. Hutagaol, and R. Harianto, “Implementation of Stacking Technique Combining Machine Learning and Deep Learning Algorithms Using SMOTE to Improve Stock Market Prediction Accuracy,” J. Appl. Data Sci., vol. 5, no. 4, pp. 2079–2091, 2024, doi: 10.47738/jads.v5i4.421.

M. Bhargav, “Comparative Analysis and Design of Different Approaches for Twitter Sentiment Analysis and classification using SVM,” Int. J. Recent Innov. Trends Comput. Commun., vol. 10, no. 9, pp. 60–66, 2022, doi: 10.17762/ijritcc.v10i9.5706.

S. N. Bhagat, “Coupling of Rough Set Theory and Predictive Power of SVM Towards Mining of Missing Data,” Int. Res. J. Multidiscip. Scope, vol. 5, no. 2, pp. 732–744, 2024, doi: 10.47857/irjms.2024.v05i02.0631.

S. Sowmya and D. Jose, “Contemplate on ECG signals and classification of arrhythmia signals using CNN-LSTM deep learning model,” Meas. Sensors, vol. 24, no. October, p. 100558, 2022, doi: 10.1016/j.measen.2022.100558.

T. D. Pham, “Classification of IHC Images of NATs with ResNet-FRP-LSTM for Predicting Survival Rates of Rectal Cancer Patients,” IEEE J. Transl. Eng. Heal. Med., vol. 11, pp. 87–95, 2023, doi: 10.1109/JTEHM.2022.3229561.

Y. Yi, “Digital twin-long short-term memory (LSTM) neural network based real-time temperature prediction and degradation model analysis for lithium-ion battery,” J. Energy Storage, vol. 64, 2023, doi: 10.1016/j.est.2023.107203.

D. Dablain, B. Krawczyk, and N. V. Chawla, “DeepSMOTE: Fusing Deep Learning and SMOTE for Imbalanced Data,” IEEE Trans. Neural Networks Learn. Syst., vol. 34, no. 9, pp. 6390–6404, 2023, doi: 10.1109/TNNLS.2021.3136503.

A. Nouriani, R. Mcgovern, and R. Rajamani, “Intelligent Systems with Applications Activity recognition using a combination of high gain observer and deep learning computer vision algorithms,” Intell. Syst. with Appl., vol. 18, no. March, p. 200213, 2023, doi: 10.1016/j.iswa.2023.200213.

J. M. Valverde, A. Shatillo, R. De Feo, and J. Tohka, “Automatic Cerebral Hemisphere Segmentation in Rat MRI with Ischemic Lesions via Attention-based Convolutional Neural Networks,” Neuroinformatics, vol. 21, no. 1, pp. 57–70, 2023, doi: 10.1007/s12021-022-09607-1.

N. Saraswathi, T. Sasi Rooba, and S. Chakaravarthi, “Improving the accuracy of sentiment analysis using a linguistic rule-based feature selection method in tourism reviews,” Meas. Sensors, vol. 29, no. May, p. 100888, 2023, doi: 10.1016/j.measen.2023.100888.

N. A. M. Zaini and M. K. Awang, “Performance Comparison between Meta-classifier Algorithms for Heart Disease Classification,” Int. J. Adv. Comput. Sci. Appl., vol. 13, no. 10, pp. 323–328, 2022, doi: 10.14569/IJACSA.2022.0131039.

E. Dumitrescu, “Machine learning for credit scoring: Improving logistic regression with non-linear decision-tree effects,” Eur. J. Oper. Res., vol. 297, no. 3, pp. 1178–1192, 2022, doi: 10.1016/j.ejor.2021.06.053.

F. E. Botchey, Z. Qin, and K. Hughes-Lartey, “Mobile money fraud prediction-A cross-case analysis on the efficiency of support vector machines, gradient boosted decision trees, and Naïve Bayes algorithms,” Inf., vol. 11, no. 8, 2020, doi: 10.3390/INFO11080383.

T. Saeed, “Neuro-XAI: Explainable deep learning framework based on deeplabV3+ and bayesian optimization for segmentation and classification of brain tumor in MRI scans,” J. Neurosci. Methods, vol. 410, 2024, doi: 10.1016/j.jneumeth.2024.110247.

I. Kayadibi, “AN EARLY RETINAL DISEASE DIAGNOSIS SYSTEM USING OCT IMAGES VIA CNN-BASED STACKING ENSEMBLE LEARNING,” Int. J. Multiscale Comput. Eng., vol. 21, no. 1, pp. 1–25, 2023, doi: 10.1615/IntJMultCompEng.2022043544.

S. S. Rani, “An Automated Lion-Butterfly Optimization (LBO) based Stacking Ensemble Learning Classification (SELC) Model for Lung Cancer Detection,” Iraqi J. Comput. Sci. Math., vol. 4, no. 3, pp. 87–100, 2023, doi: 10.52866/ijcsm.2023.02.03.008.

L. Wang, “Axial Dual Atomic Sites Confined by Layer Stacking for Electroreduction of CO2 to Tunable Syngas,” J. Am. Chem. Soc., vol. 145, no. 24, pp. 13462–13468, 2023, doi: 10.1021/jacs.3c04172.

J. Xie, “Corrosion mechanism of Mg alloys involving elongated long-period stacking ordered phase and intragranular lamellar structure,” J. Mater. Sci. Technol., vol. 151, pp. 190–203, 2023, doi: 10.1016/j.jmst.2023.01.005.

R. E. Ako, “Pilot Study on Fibromyalgia Disorder Detection via XGBoosted Stacked-Learning with SMOTE-Tomek Data Balancing Approach,” Nipes J. Sci. Technol. Res., vol. 7, no. 1, pp. 12–22, 2025, doi: 10.37933/nipes/7.1.2025.2.

A. Kanwal, “MK-SMOTE and M-SMOTE: enhanced techniques for handling class imbalance problem,” Iran J. Comput. Sci., 2025, doi: 10.1007/s42044-025-00240-0.

A. Kishor, “Early and accurate prediction of diabetics based on FCBF feature selection and SMOTE,” Int. J. Syst. Assur. Eng. Manag., vol. 15, no. 10, pp. 4649–4657, 2024, doi: 10.1007/s13198-021-01174-z.

V. D. Gowda, “A novel RF-SMOTE model to enhance the definite apprehensions for IoT security attacks,” J. Discret. Math. Sci. Cryptogr., vol. 26, no. 3, pp. 861–873, 2023, doi: 10.47974/JDMSC-1766.

A. Puri, “Improved Hybrid Bag-Boost Ensemble with K-Means-SMOTE-ENN Technique for Handling Noisy Class Imbalanced Data,” Comput. J., vol. 65, no. 1, pp. 124–138, 2022, doi: 10.1093/comjnl/bxab039.

J. Nanda, “SSHM: SMOTE-stacked hybrid model for improving severity classification of code smell,” Int. J. Inf. Technol. Singapore, vol. 14, no. 5, pp. 2701–2707, 2022, doi: 10.1007/s41870-022-00943-8.

P. C. Y. Cheah, “Enhancing Financial Fraud Detection through Addressing Class Imbalance Using Hybrid SMOTE-GAN Techniques,” Int. J. Financ. Stud., vol. 11, no. 3, 2023, doi: 10.3390/ijfs11030110.

J. Chen, “Machine learning-based classification of rock discontinuity trace: SMOTE oversampling integrated with GBT ensemble learning,” Int. J. Min. Sci. Technol., vol. 32, no. 2, pp. 309–322, 2022, doi: 10.1016/j.ijmst.2021.08.004.

Asniar, “SMOTE-LOF for noise identification in imbalanced data classification,” J. King Saud Univ. Comput. Inf. Sci., vol. 34, no. 6, pp. 3413–3423, 2022, doi: 10.1016/j.jksuci.2021.01.014.

W. Tan, “Severe rock burst prediction based on the combination of LOF and improved SMOTE algorithm,” Yanshilixue Yu Gongcheng Xuebao Chinese J. Rock Mech. Eng., vol. 40, no. 6, pp. 1186–1194, 2021, doi: 10.13722/j.cnki.jrme.2020.1035.

B. Prasetiyo, “Evaluation performance recall and F2 score of credit card fraud detection unbalanced dataset using SMOTE oversampling technique,” J. Phys. Conf. Ser., vol. 1918, no. 4, 2021, doi: 10.1088/1742-6596/1918/4/042002.

N. Mqadi, “A SMOTe based oversampling data-point approach to solving the credit card data imbalance problem in financial fraud detection,” Int. J. Comput. Digit. Syst., vol. 10, no. 1, pp. 277–286, 2021, doi: 10.12785/IJCDS/100128.

A. Rehman, T. Alam, M. Mujahid, F. S. Alamri, B. Al Ghofaily, and T. Saba, “RDET stacking classifier: a novel machine learning based approach for stroke prediction using imbalance data,” PeerJ Comput. Sci., vol. 9, pp. 1–28, 2023, doi: 10.7717/peerj-cs.1684.

M. Waqar, H. Dawood, H. Dawood, N. Majeed, A. Banjar, and R. Alharbey, “An Efficient SMOTE-Based Deep Learning Model for Heart Attack Prediction,” Sci. Program., vol. 2021, 2021, doi: 10.1155/2021/6621622.

C. W. Teoh, S. B. Ho, K. S. Dollmat, and C. H. Tan, “Ensemble-Learning Techniques for Predicting Student Performance on Video-Based Learning,” Int. J. Inf. Educ. Technol., vol. 12, no. 8, pp. 741–745, 2022, doi: 10.18178/ijiet.2022.12.8.1679.

T. Wu, “Intrusion detection system combined enhanced random forest with SMOTE algorithm,” EURASIP J. Adv. Signal Process., vol. 2022, no. 1, 2022, doi: 10.1186/s13634-022-00871-6.

B. S. Raghuwanshi, “Classifying imbalanced data using SMOTE based class-specific kernelized ELM,” Int. J. Mach. Learn. Cybern., vol. 12, no. 5, pp. 1255–1280, 2021, doi: 10.1007/s13042-020-01232-1.




DOI: https://doi.org/10.47738/jads.v6i4.916

Refbacks

  • There are currently no refbacks.



Barcode

Journal of Applied Data Sciences

ISSN:2723-6471 (Online)
Publisher:Bright Publisher
Website:http://bright-journal.org/JADS
Email:taqwa@amikompurwokerto.ac.id (principal contact)
  support@bright-journal.org (technical issues)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0