https://github.com/ishutak/stock_prediction_project
A stock price prediction model using Long Short-Term Memory (LSTM) neural networks combined with sentiment analysis of financial news articles. Developed using Python, Used TensorFlow, NLTK, and various data science libraries.
https://github.com/ishutak/stock_prediction_project
deep-learning lstm machine-learning nltk python sentiment-analysis stock-price-prediction tensorflow time-series
Last synced: 5 months ago
JSON representation
A stock price prediction model using Long Short-Term Memory (LSTM) neural networks combined with sentiment analysis of financial news articles. Developed using Python, Used TensorFlow, NLTK, and various data science libraries.
- Host: GitHub
- URL: https://github.com/ishutak/stock_prediction_project
- Owner: IshuTak
- Created: 2025-01-31T18:54:07.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-21T15:30:27.000Z (over 1 year ago)
- Last Synced: 2025-04-13T15:40:51.480Z (about 1 year ago)
- Topics: deep-learning, lstm, machine-learning, nltk, python, sentiment-analysis, stock-price-prediction, tensorflow, time-series
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stock Price Prediction with LSTM and Sentiment Analysis
## Overview
This project predicts stock prices using an LSTM neural network combined with sentiment analysis from financial news articles. It incorporates technical indicators and sentiment scores to improve prediction accuracy.
## Features
- **Data Collection**: Fetches historical stock data using `yfinance` and performs daily sentiment analysis using NewsAPI and NLTK's VADER.
- **Technical Indicators**: Calculates various technical indicators such as Moving Averages (MA), Moving Average Convergence Divergence (MACD), Relative Strength Index (RSI), and more.
- **Data Preparation**: Preprocesses and scales data, and prepares it for model training.
- **Modeling**: Builds and trains an LSTM neural network with optimized architecture and hyperparameters.
- **Prediction and Evaluation**: Makes future stock price predictions and evaluates model performance using metrics like MSE, RMSE, MAE, and MAPE.
- **Visualization**: Provides visualizations of actual vs. predicted stock prices and training loss graphs.
- **Monte Carlo Simulation**: Uses Monte Carlo simulations to estimate prediction confidence intervals.
## Dataset
- **Stock Data**: Historical stock prices for NVIDIA Corporation (NVDA) over the past three years.
- **News Data**: Financial news articles related to NVDA fetched using NewsAPI.
- **Technical Indicators**: Calculated from stock data.
- **Sentiment Scores**: Derived from news articles using NLTK's VADER sentiment analyzer.
## Installation
- pandas==1.4.2
- numpy==1.21.5
- yfinance==0.1.70
- nltk==3.6.7
- scikit-learn==1.0.2
- requests==2.27.1
- tensorflow==2.8.0
- matplotlib==3.5.1
### Prerequisites
- Python 3.6 or higher
- Git
- pip
### Steps
1. **Clone the Repository**:
```bash
git clone https://github.com/IshuTak/stock_prediction_project.git