Explanation

Gold price forecasting datetime-based using Python

Using Yahoo Finance, historical gold prices (2000-2025) were scraped for XAU/USD. Features were extracted (year, month, day, week, etc.). Various regression models were trained: Linear, Polynomial, SVR, KNN, XGBoost, GradientBoost, Decision Tree, Random Forest. Best performing (XGBoost) was used for forecasting with matplotlib visualization. Data was converted to multiple currency formats and used in Power BI.

Result

XGBRegressor:

R2 Score:0.9978
MSE:790.49
XGBoost model gives near-perfect accuracy.

Below is the Power BI Dashboard overview:

• Global Gold volume:6.77 billion
• Change Price:37.14k,
• Change %:-3.85%
• Yearly trends and country-wise comparison show insights about global economy and currency impact.

Conclusion

The XGBoost model achieved an impressive R2 score of 0.9978, indicating its effectiveness in predicting gold prices. The Power BI dashboard provides overview of the global gold market and highlighting trends.The analysis of gold prices in multiple currencies further enhances the understanding of market dynamics, making it a valuable tool for investors.

Back