Technologies Used:
-
Django (Web Framework): Provides a robust and scalable web application structure.
-
Pandas and NumPy (Data Analysis): Used for data manipulation and analysis.
-
Scikit-Learn (Machine Learning): Implements the linear regression model for gold price prediction.
-
YFinance (Yahoo Finance API): Fetches historical gold price data for analysis.
-
Plotly (Data Visualization): Creates interactive and visually appealing plots.
-
Pytz (Timezone Handling): Manages user timezones.
-
Requests (HTTP Library): Used for integrating external API for real-time gold prices.
-
HTML, CSS, JavaScript (Frontend): Standard web technologies for frontend development.
-
Gold API (External Gold Price API): An external API is integrated to fetch real-time gold prices.
-
Data Collection with Yahoo Finance The application fetches historical gold price data from Yahoo Finance using the yfinance library. This data includes the daily closing prices of the Gold ETF ('GLD').
-
Exploratory Data Analysis (EDA)
Features:
- Closing Price Plot: Visualizes the historical closing prices of the Gold ETF using Plotly.
- Linear Regression Model: Utilizes a linear regression model with 3-day and 9-day moving averages as explanatory variables.
- Prediction Plot: Compares predicted gold prices with actual prices for the test dataset.
- Cumulative Returns: Calculates and displays cumulative returns based on predicted price movements.
-
Model Training and Testing The dataset is split into training and testing sets, with 80% used for training the linear regression model and 20% for testing.
-
Gold Price Prediction The trained linear regression model is used to predict gold prices for the test dataset, and the results are compared with actual prices.
-
Web Application Features
Pages:
-
Home Page: Provides an overview of closing price plots, prediction plots, cumulative returns, and current predictions.
-
Information Page: Details about the linear regression model, R-squared score, and other relevant information.
-
Plots Page: Displays closing price, prediction, and cumulative returns plots.
-
Gold Price Page: Fetches and displays real-time gold prices from an external API.
Additional Pages:
-
Cookie Page: Demonstrates setting and retrieving cookies.
-
Timezone Page: Demonstrates setting and retrieving user timezones.
-
Info Page: Displays gold price information over the past 15 days and full historical data.
- Clone the repository
- Navigate to the project directory
- Install the required Python packages : pip install -r requirements.txt
- Run migrations: python manage.py migrate
- Start the development server: python manage.py runserver
- Open your web browser and go to http://localhost:8000/ to access the Gold Price Prediction Web App.
If you find this work useful for your research or project, please consider citing it.