This project leverages LSTM neural networks for stock price prediction, tailored to multiple manufacturers. The system is designed to preprocess, train, evaluate, and visualize stock trends with high accuracy, and includes a user-friendly dashboard for tracking predictions and insights over time.
- Data Processing and Preparation: Preprocesses stock data with scaling and sequence generation for LSTM.
- LSTM Model Training: Customizable LSTM model with flexible hidden layers and dropout for improved generalization.
- Performance Evaluation: Computes MSE and R-squared metrics and saves results in JSON format for further analysis.
- Visualization and Dashboard: Streamlit-based dashboard with interactive visualizations using Plotly for easy exploration of stock trends, moving averages, daily returns, and high-low spreads.
train.py
: Prepares data, trains the model, evaluates performance, and saves results.model.py
: DefinesStockPriceLSTM_v1
andStockPriceLSTM_v2
for modeling time-series data.app.py
: Streamlit app for visualizing stock trends, metrics, and prediction insights.Data_Preparations.py
,evaluation.py
,config.py
: Modules for preprocessing, evaluation, and configuration.
- Python 3.7+
- Required libraries:
torch
,numpy
,pandas
,streamlit
,plotly
Clone the repository and install dependencies:
git clone https://github.com/yourusername/stock-price-prediction
pip install -r requirements.txt
To train the model on multiple companies, run:
python train.py
Launch the Streamlit app to visualize predictions:
streamlit run app.py
Each trained model is saved with its metrics and visualizations, providing a clear view of performance and prediction accuracy.