How suyashagnihotri/share-market-price-prediction works
Project type and purpose
• This is an ML-based, single-page web application whose goal is to train an LSTM on historical stock data (in a Jupyter notebook) and then serve real-time predictions and visualizations via a Streamlit app.
File structure
• .devcontainer/ → development container config for reproducible environment (VSCode dev‐container)
• LSTM.ipynb → training pipeline (data ingestion, feature engineering, model fitting)
• STOCK.keras → persisted Keras LSTM model file (inference artifact)
• lstm_real.py → Streamlit application for model loading, data fetching, prediction, and UI
• requirements.txt → Python dependencies (Keras/TensorFlow, Streamlit, pandas, yfinance/TA-libs, etc.)
README for additional insights
• Confirms two main workflows: “train & save LSTM” vs. “load & infer in Streamlit.”
• Mentions OHLCV data retrieval, technical indicator computation, real-time plotting.
Main components & interactions
a. Model Training Pipeline (Offline)
• Data Loader: imports historical OHLCV from CSV or API
• Preprocessor: scales and window-frames time series
• LSTM Trainer (Keras): defines, fits model
• Artifact Store: writes out STOCK.keras to disk
b. Model Serving / Inference (Online)
• Streamlit App (lstm_real.py): exposes web UI
• Data Fetcher: calls external API (e.g., yfinance) for recent OHLCV
• Feature Processor: computes indicators and windows matching training
• Model Loader: loads STOCK.keras
• Inference Engine: runs model.predict(…)
• Visualization Module: plots OHLCV + indicators + forecast
• Browser UI: end user sees interactive charts
c. Supporting Infrastructure
• Dev Container: Docker/VSCode for consistent dev environment
• Version Control: .gitignore + Git repo
Architectural patterns & design principles
• Separation of concerns: Training vs. Serving are entirely decoupled
• Pipeline pattern: sequential data flow in both train and serve paths
• Artifact management: single model file (STOCK.keras) as contract between train/serve
• External integration: data fetched at runtime from public API