How duemig/stanford-project-predicting-stock-prices-using-a-lstm-network works
Project Type and Purpose
• This is a research‐oriented machine‐learning project, implemented as a Jupyter notebook, whose goal is to train, validate, and compare LSTM networks (against logistic regression baselines) for out‐of‐sample stock‐price prediction.
• There is no standalone frontend or backend application; rather it’s a data‐science pipeline contained within “Final Project.ipynb,” supported by a README and a written report (report.pdf).
Core Architectural Components
From the file tree and README, we can extract four main components:
a. Data Ingestion & Storage
• Historical price/volume data sources (CSV, APIs, or databases).
• Local data files or connections to remote data APIs.
b. Preprocessing & Feature Generation
• Time‐series windowing, normalization, and feature matrix assembly.
• Train/test split logic and baseline feature sets for logistic regression.
c. Model Training & Evaluation
• LSTM‐based neural network training pipeline.
• Baseline logistic regression pipeline.
• Hyperparameter tuning loops, cross‐validation.
d. Results & Reporting
• Performance metrics calculation (accuracy, return predictions, loss curves).
• Generation of tables, plots, and PDF report.
Relationships & Data Flows
• Data flows from the ingestion component into preprocessing.
• Preprocessed datasets feed two parallel branches: the LSTM pipeline and the logistic regression baseline.
• Each branch outputs metrics and model artifacts, which feed into the reporting component.
• The notebook orchestrates all steps in sequence, serving as both controller and interactive UI.
Architectural Patterns & Design Principles
• Modular pipeline: separate data‐prep, modeling, and evaluation stages.
• Parallel execution for baseline vs. advanced models.
• Code‐as‐documentation: the Jupyter notebook doubles as orchestrator and interactive documentation.
• Reproducibility: version‐controlled notebook, explicit data‐split and random‐seed management.
Detailed Steps for the Principal Software Engineer
a. Sketch a left‐to‐right pipeline: raw data inputs on the far left, outputs on the far right.
d. External dependencies (Python, TensorFlow/PyTorch for LSTM, scikit‐learn for logistic regression) as side annotations.
e. Use consistent naming drawn from the README (“LSTM Network,” “baseline logistic regression,” etc.).