How jebin1999/algotrading- works
Project type and purpose
• This is a single-script Python application for time-series forecasting. It uses an LSTM neural network to predict stock prices based on historical data fetched from Yahoo Finance.
File structure
• There are only two top-level files:
• CopyLSTMPredAPPL.py – the main Python script that orchestrates data fetching, preprocessing, model training, prediction, and visualization
• README.md – documentation
README for additional insights
• The README confirms the workflow:
• Fetch stock data via yfinance
• MinMax scaling preprocessing
• Build & train LSTM (TensorFlow)
• Plot actual vs. predicted
• No external microservices or databases—everything runs in-memory in one script
a. Main components
1. Data Source (Yahoo Finance API)
2. Data Ingestion Module (yfinance wrapper)
3. Preprocessing Module (pandas + scikit-learn MinMaxScaler)
4. Model Training Module (TensorFlow LSTM)
5. Prediction Module (uses trained LSTM to forecast)
6. Visualization Module (matplotlib)
7. Logging / Configuration (script parameters, hyperparameters)
b. Relationships & interactions
• Ingestion Module → Preprocessing
• Preprocessing → Model Training
• Trained Model → Prediction Module
• Prediction Module → Visualization
• All modules read global config/hyperparameters
c. Architectural patterns & design principles
• Linear data-pipeline (ETL → Model → Output)
• Single responsibility per component
d. Key technologies & libraries
• numpy & pandas for data handling
• yfinance for live historical data fetch
• scikit-learn’s MinMaxScaler for normalization
• tensorflow.keras for LSTM model
• matplotlib for plotting