Welcome to the Gold Price Prediction project! This repository contains the code and data used to predict the future adjusted closing price of Gold ETF. Using machine learning techniques, we aim to create an accurate model that helps in forecasting gold prices.
Check out my GitHub profile for more cool projects!
This project uses a RandomForestRegressor model to predict the adjusted closing price of Gold ETF based on various features including stock prices and trends from different markets.
The dataset includes the following columns:
- Date: The date of the record.
- Open, High, Low, Close, Adj Close: Gold ETF price metrics.
- Volume: Trading volume.
- SP, DJ, EG, EU, OF, OS, SF, USB, PLT, PLD, RHO, USDI, GDX, USO: Various market indices and their respective metrics.
- Convert the 'Date' column to datetime format.
- Drop the 'Date' and 'Adj Close' columns from the features.
- Standardize the features using
StandardScaler
.
We use a RandomForestRegressor
model to predict the adjusted closing price of Gold ETF. The model is evaluated using the following metrics:
- Mean Squared Error (MSE)
- Mean Absolute Error (MAE)
- R-squared (RΒ²)
Metric | Training Set | Testing Set |
---|---|---|
MSE | 0.0048 | 0.0769 |
MAE | 0.0257 | 0.0732 |
RΒ² | 0.99998 | 0.99975 |
Here's a visualization of the actual vs predicted values for both the training and testing sets:
- Clone the repository:
git clone https://github.com/Armanx200/Gold-Price-Prediction.git
- Install the required packages:
pip install -r requirements.txt
- Run the code:
python main.py
Contributions are welcome! Please fork this repository and submit a pull request for any changes you'd like to make.
This project is licensed under the MIT License.
For any questions or suggestions, feel free to open an issue or contact me at Armanx200.
Happy predicting! π