Application of Genetic Algorithm for Random Forest Hyperparameter Optimization in Forecasting Indonesia's Monthly Oil and Gas Export Value by Destination Country
Keywords:
genetic algorithm, random forest, hyperparameter optimization, time series forecasting, oil and gas exportsAbstract
Indonesia's oil and gas export value fell by 17.69 percent in 2025 and fluctuated sharply from month to month, so foreign exchange policy needs accurate forecasts. This study applies a Genetic Algorithm to optimize the hyperparameters of a Random Forest for forecasting Indonesia's monthly oil and gas export value by destination country. The data come from Statistics Indonesia (BPS) for January 2022 to July 2026 and cover 27 destination countries or regions. The features are the values of the previous one to three months, the three-month moving average, the month, and the country. Data from 2022 to 2025 were used for training and data from 2026 for testing, while the fitness function of the Genetic Algorithm was the RMSE on 2025 validation data. The Genetic Algorithm selected 50 trees, a maximum depth of 5, a minimum of 5 samples per leaf, and sqrt for max_features. On the test data, RMSE fell from 48,460.01 to 44,998.70 thousand US$ (7.14 percent) and WAPE fell from 45.09 to 42.70 percent compared with the default Random Forest. However, random search with the same evaluation budget produced an RMSE of 44,661.51, and a three-month moving average produced an RMSE of 40,708.76. This study concludes that hyperparameter optimization improves the Random Forest, but the advantage of the Genetic Algorithm over random search is not supported by this data.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Maha Valne Datin Mahfujah Tambunan (Author); Muhammad Syahputra Novelan

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.










