Accurate weather forecasting is crucial for various sectors, including agriculture, transportation, and disaster management. The weather data used includes variables such as humidity, temperature, and wind speed collected from weather stations across North Sumatra. The Random Forest method is an ensemble algorithm based on decision trees known for its ability to handle overfitting and provide accurate results. On the other hand, XGBoost is a boosting technique that improves model performance through iterative learning, correcting errors made by previous models. Research results show that both methods have their respective advantages in terms of accuracy and prediction speed. The Random Forest method yields a Root Mean Squared Error (RMSE) of 0.753732 and a Coefficient of Determination (R²) of 0.736315. In contrast, XGBoost shows a slightly lower RMSE of 0.737818 and a higher R² of 0.747332. It is concluded that XGBoost performs slightly better in minimizing prediction errors (RMSE) and improving model fit to the data (R²) compared to Random Forest.
Copyrights © 2025