Skip to content

beyondequations/gold-vs-dollar-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Gold vs Dollar Prediction Project

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.

Project Structure

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

Models Used

  • 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.

Features

  • 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

How to Run

Step 1: Install dependencies

pip install -r requirements.txt

Step 2: Train the models

python 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.py

Step 3: Generate predictions

Each script will ask for user input:

python scripts/predict_with_Lasso_day.py

Inputs required:

  • Date (YYYY-MM-DD)
  • Time (HH:MM)
  • Open, High, Low, Close values

Step 4: View interactive plot

  • After prediction, a Plotly chart will open showing the 24-hour forecast.

Sample Output

  • Time-series line plot for closing prices
  • Hover-over candlestick info
  • Simulated OHLC + volume data

Example Use Case

Use this toolkit to:

  • Analyze market trends
  • Backtest simple prediction models
  • Compare machine learning vs statistical models for time-based data

Credits

Developed by Lavian Dsouza Email: lavianvishal23@gmail.com LinkedIn: lavian-dsouza-msc-4975442ab

License

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"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages