https://github.com/sayan520/stock-market-prediction
This project aims to develop a stock market prediction model using Deep learning techniques to predict stock market trends. The model will be trained on historical stock market data, including various features such as stock prices, trading volumes, and other relevant indicators.
https://github.com/sayan520/stock-market-prediction
deep-learning long-short-term-memory machine-learning python
Last synced: 7 months ago
JSON representation
This project aims to develop a stock market prediction model using Deep learning techniques to predict stock market trends. The model will be trained on historical stock market data, including various features such as stock prices, trading volumes, and other relevant indicators.
- Host: GitHub
- URL: https://github.com/sayan520/stock-market-prediction
- Owner: Sayan520
- Created: 2024-07-05T16:42:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T15:47:36.000Z (11 months ago)
- Last Synced: 2025-02-03T10:33:53.387Z (9 months ago)
- Topics: deep-learning, long-short-term-memory, machine-learning, python
- Language: Jupyter Notebook
- Homepage: https://github.com/Sayan520/Stock-Market-Prediction/
- Size: 5.35 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stock Market Prediction

This project builds a deep learning model using **LSTM (Long Short-Term Memory)** to predict Tesla's stock prices and visualize the predictions using **Streamlit**, a Python library for creating interactive web applications.
## Features
1. **Data Preprocessing:**
- Loads Tesla's historical stock price data from a CSV file.
- Splits the data into training and testing sets (70% for training and 30% for testing).
- Scales the data using **MinMaxScaler** for better performance with the LSTM model.2. **Model Architecture:**
- An LSTM-based neural network with:
- Four stacked LSTM layers of varying units.
- Dropout layers to prevent overfitting.
- A Dense output layer for single-value predictions.
- Optimized using the **Adam optimizer** with **mean squared error (MSE)** as the loss function.3. **Model Evaluation:**
- Predictions on test data are compared with actual prices using metrics like:
- **Mean Absolute Error (MAE)**.
- **Mean Squared Error (MSE)**.
- **R2 Score**.
- Visualization of results using:
- Line chart for predicted vs. actual prices.
- Scatter plot to visualize the correlation between predictions and actual values.
- R2 score represented as a horizontal bar chart.4. **Interactive Streamlit Interface:**
- Displays Tesla's closing price trends.
- Evaluates and visualizes model performance.
- Allows users to input the number of future days for prediction.
- Shows the predicted future stock prices using a line chart.5. **Moving Average Analysis:**
- Computes and visualizes the **100-day** and **200-day moving averages** for trend comparison.## How to Run the Project
1. Install required libraries:
```bash
pip install streamlit pandas numpy matplotlib scikit-learn tensorflow
## How to Prepare and Run the App2. Save the dataset (`TSLA Training.csv`) in the appropriate directory.
3. Run the Streamlit app:
```bash
streamlit run app.py