This repository contains a set of machine learning and time series forecasting models designed to predict the price movement of Gold against the US Dollar. The models simulate a 24-hour forecast using historical gold price data and present interactive OHLCV (Open, High, Low, Close, Volume) charts for analysis.
gold-vs-dollar-prediction/
│
├── data/
│ └── gold_dollar_data.csv # Sample input dataset
│
├── models/
│ ├── trained_lasso_model.joblib
│ ├── trained_linear_model.joblib
│ ├── trained_ridge_model.joblib
│ └── timestamp_scaler.joblib
│
├── scripts/
│ ├── train_Lasso_model.py
│ ├── train_OLS_model.py
│ ├── train_Ridge_model.py
│ ├── train_RidgeCV_model.py
│ ├── train_prophet_model.py
│ ├── predict_with_Lasso_day.py
│ ├── predict_with_OLS_day.py
│ ├── predict_with_Ridge_day.py
│ ├── predict_with_RidgeCV_day.py
│ └── predict_with_prophet_day.py
│
├── README.md
└── requirements.txt
- Ordinary Least Squares (OLS): Basic linear regression using timestamp as a predictor.
- Lasso Regression: L1-regularized regression to reduce overfitting.
- Ridge Regression / RidgeCV: L2-regularized regression with cross-validation.
- Facebook Prophet: Time series forecasting for capturing seasonality and trends.
- Input custom datetime and initial OHLC data
- Forecast next 24 hours in 5-minute intervals
- Visualize predictions with interactive Plotly charts
- Compare performance of different regression techniques
pip install -r requirements.txtpython scripts/train_Lasso_model.py
python scripts/train_OLS_model.py
python scripts/train_Ridge_model.py
python scripts/train_RidgeCV_model.py
python scripts/train_prophet_model.pyEach script will ask for user input:
python scripts/predict_with_Lasso_day.pyInputs required:
- Date (YYYY-MM-DD)
- Time (HH:MM)
- Open, High, Low, Close values
- After prediction, a Plotly chart will open showing the 24-hour forecast.
- Time-series line plot for closing prices
- Hover-over candlestick info
- Simulated OHLC + volume data
Use this toolkit to:
- Analyze market trends
- Backtest simple prediction models
- Compare machine learning vs statistical models for time-based data
Developed by Lavian Dsouza Email: lavianvishal23@gmail.com LinkedIn: lavian-dsouza-msc-4975442ab
MIT License. You are free to use, modify, and share this project.
This is part of my personal AI & Data portfolio: "Predicting Gold vs Dollar Prices: A Data-Driven Forecasting Approach"