Introduction This project explores the application of deep learning techniques to predict stock prices. We developed a custom Convolutional Neural Network (CNN) and experimented with pre-trained models like ResNet50, InceptionV3, and DenseNet121. The goal is to predict stock prices based on historical market data and make informed trading decisions. This repository includes the implementation of the models, data preprocessing, evaluation, and deployment using a user-friendly interface.
- Install Kaggle Dataset from https://www.kaggle.com/datasets/jacksoncrow/stock-market-dataset
- pip install -r requirements.txt to install all dependencies
Custom CNN Model: Developed a CNN model to predict stock prices from historical market data. Pre-Trained Models: Fine-tuned pre-trained models (ResNet50, InceptionV3, DenseNet121) for stock price prediction. Ensemble Model: Combined predictions from multiple models using an ensemble approach. Deployment: Created a Gradio interface for user interaction and prediction visualization.
ResNet50: (https://keras.io/api/applications/resnet/#resnet50-function)
InceptionV3: https://keras.io/api/applications/inceptionv3/
DenseNet121: https://keras.io/api/applications/densenet/#densenet121-function
Stock Price Prediction: Predict future stock prices based on historical data.
Custom and Pre-Trained Models: Utilize both custom CNN and pre-trained models.
Ensemble Learning: Combine predictions from multiple models for improved accuracy.
User Interface: Interactive Gradio interface for easy user interaction.
To get started, clone the repository and install the required packages.
Copy code
-
git clone https://github.com/your-username/stock-trading-bot.git
-
cd stock-trading-bot
-
pip install -r requirements.txt
Ensure that the stock data is available in the archive/stocks directory. Each stock's data should be in a separate CSV file with the stock symbol as the filename.
You can run the setup.ipynb Jupyter notebook to train the models and make predictions. The notebook includes detailed steps for data preprocessing, model training, and evaluation.
Launch the Gradio interface for an interactive experience.
Gradio Interface
The Gradio interface allows users to:
Select a stock symbol.
Set initial capital, start, and end dates.
View predicted prices, plots, and trading decisions.
The interface also includes a chatbot for quick stock-related queries.
The models were evaluated using the following metrics:
Mean Squared Error (MSE)
Mean Absolute Error (MAE)
R-squared (R²)
Confusion Matrix
ROC Curve
Precision-Recall Curve