How walids35/capstone-stock-prediction works
This framework turns market/news data into sentiment-enriched stock forecasts, then supports model evaluation, visualization, and trading analysis. The documented workflow spans data preparation, sentiment scoring, feature engineering, model training/inference, and result analysis. The graph preserves the four model families and their shared transformer/TimesNet building blocks. Several links rely on the SOURCE INDEX import references or README workflow; unsampled implementation details and data-source wiring are not inferred.
Main entry points: dataset_pipeline.py Sequence Pipeline · PatchTST.py PatchTST Model · main.py Sentiment Workflow · trading_simulation.py Trading Simulation
Components 34
Data Preparation
- Data Collection
stock_prediction/dataset.py - Sequence Pipeline
stock_prediction/dataset_pipeline.py - Feature Engineering
stock_prediction/features.py
News Sentiment
- Sentiment Workflow
sentiment_analysis/main.py - Model Comparison
sentiment_analysis/models/base.py - Transformer Classifier
sentiment_analysis/models/bert_model.py - Financial News Comparison
sentiment_analysis/comparison/financial.py - Stock News Comparison
sentiment_analysis/comparison/stock.py - Sentiment Trainer
sentiment_analysis/trainers/model_trainer.py
Forecasting
- LSTM Model
stock_prediction/modeling/LSTM.py - PatchTST Model
stock_prediction/modeling/PatchTST.py - TimesNet Model
stock_prediction/modeling/TimesNet.py - tPatchGNN Model
stock_prediction/modeling/tPatchGNN.py - Model Training
stock_prediction/modeling/train.py - PatchTST Training
stock_prediction/modeling/train_patchtst.py - TimesNet Training
stock_prediction/modeling/train_timesnet.py - tPatchGNN Training
stock_prediction/modeling/train_tpatchgnn.py - LSTM Inference
stock_prediction/modeling/predict.py - PatchTST Inference
stock_prediction/modeling/predict_patchtst.py - TimesNet Inference
stock_prediction/modeling/predict_timesnet.py - tPatchGNN Inference
stock_prediction/modeling/predict_tpatchgnn.py
Analysis & Trading
- Visualization
stock_prediction/plots.py - Trading Simulation
stock_prediction/trading_simulation.py
Shared Components
- Project Configuration
stock_prediction/config.py - Experiment Settings
utils/ExpConfigs.py - Run Configuration
utils/configs.py - Forecast Metrics
utils/metrics.py - Training Utilities
utils/tools.py - Transformer Embeddings
layers/Formers/Embed.py - Attention Layers
layers/Formers/SelfAttention_Family.py - Transformer Encoder
layers/Formers/Transformer_EncDec.py - TimesNet Convolutions
layers/TimesNet/Conv_Blocks.py
Other components
- Market Data Sources
- News Data Sources
Connections 48
- Market Data Sources → Data Collection: provides prices
README.md - News Data Sources → Data Collection: provides news
README.md - Data Collection → Sequence Pipeline: prepare sequences
README.md - Sequence Pipeline → Feature Engineering: feeds features
README.md - Sentiment Workflow → Financial News Comparison: runs analysis
sentiment_analysis/main.py - Sentiment Workflow → Stock News Comparison: runs analysis
sentiment_analysis/main.py - Sentiment Workflow → Sentiment Trainer: trains classifier
sentiment_analysis/main.py - Financial News Comparison → Model Comparison: inherits comparison
sentiment_analysis/comparison/financial.py - Stock News Comparison → Model Comparison: inherits comparison
sentiment_analysis/comparison/stock.py - Model Comparison → Transformer Classifier: wraps classifiers
sentiment_analysis/models/base.py - Sequence Pipeline → Model Training: supplies sequences
README.md - Sequence Pipeline → PatchTST Training: supplies sequences
stock_prediction/modeling/train_patchtst.py - Sequence Pipeline → TimesNet Training: supplies sequences
stock_prediction/modeling/train_timesnet.py - Sequence Pipeline → tPatchGNN Training: supplies sequences
stock_prediction/modeling/train_tpatchgnn.py - PatchTST Training → PatchTST Model: trains model
stock_prediction/modeling/train_patchtst.py - TimesNet Training → TimesNet Model: trains model
stock_prediction/modeling/train_timesnet.py - tPatchGNN Training → tPatchGNN Model: trains model
stock_prediction/modeling/train_tpatchgnn.py - Model Training → LSTM Model: trains model
README.md - PatchTST Inference → PatchTST Model: loads model
stock_prediction/modeling/predict_patchtst.py - TimesNet Inference → TimesNet Model: loads model
stock_prediction/modeling/predict_timesnet.py - tPatchGNN Inference → tPatchGNN Model: loads model
stock_prediction/modeling/predict_tpatchgnn.py - LSTM Inference → LSTM Model: runs inference
README.md - PatchTST Model → Transformer Embeddings: uses embeddings
stock_prediction/modeling/PatchTST.py - PatchTST Model → Attention Layers: uses attention
stock_prediction/modeling/PatchTST.py - PatchTST Model → Transformer Encoder: uses encoder
stock_prediction/modeling/PatchTST.py - TimesNet Model → Transformer Embeddings: uses embeddings
stock_prediction/modeling/TimesNet.py - TimesNet Model → TimesNet Convolutions: uses convolutions
stock_prediction/modeling/TimesNet.py - PatchTST Training → Experiment Settings: uses settings
stock_prediction/modeling/train_patchtst.py - TimesNet Training → Experiment Settings: uses settings
stock_prediction/modeling/train_timesnet.py - tPatchGNN Training → Experiment Settings: uses settings
stock_prediction/modeling/train_tpatchgnn.py - PatchTST Inference → Forecast Metrics: computes scores
stock_prediction/modeling/predict_patchtst.py - TimesNet Inference → Forecast Metrics: computes scores
stock_prediction/modeling/predict_timesnet.py - tPatchGNN Inference → Forecast Metrics: computes scores
stock_prediction/modeling/predict_tpatchgnn.py - PatchTST Training → Training Utilities: uses utilities
stock_prediction/modeling/train_patchtst.py - TimesNet Training → Training Utilities: uses utilities
stock_prediction/modeling/train_timesnet.py - tPatchGNN Training → Training Utilities: uses utilities
stock_prediction/modeling/train_tpatchgnn.py - Run Configuration → Experiment Settings: constructs settings
utils/configs.py - Trading Simulation → Sequence Pipeline: prepares sequences
stock_prediction/trading_simulation.py - Trading Simulation → PatchTST Model: supports model
stock_prediction/trading_simulation.py - Trading Simulation → TimesNet Model: supports model
stock_prediction/trading_simulation.py - Trading Simulation → tPatchGNN Model: supports model
stock_prediction/trading_simulation.py - Trading Simulation → LSTM Model: supports model
stock_prediction/trading_simulation.py - Visualization → Project Configuration: uses paths
stock_prediction/plots.py - Sentiment Workflow → Project Configuration: uses project paths
sentiment_analysis/main.py - Data Collection → Project Configuration: uses paths
stock_prediction/dataset.py - Sentiment Workflow → Stock News Comparison: builds comparison tables
sentiment_analysis/main.py - PatchTST Inference → Run Configuration: uses run settings
stock_prediction/modeling/predict_patchtst.py - TimesNet Inference → Run Configuration: uses run settings
stock_prediction/modeling/predict_timesnet.py