How kittencn/stock_prediction works
This is a PyTorch stock time-series research project. Its principal workflow is to acquire market data, prepare features, train a selected forecasting model, and run predictions for evaluation. The README also documents a broad model menu and configuration/normalization artifacts, which are represented as capabilities rather than as a fully specified internal call graph. Source excerpts are partial, so uncertain wiring between package modules is omitted.
Main entry points: train.py Training workflow · predict.py Inference workflow · getdata.py Market data loading · data_preprocess.py Data preprocessing
Components 21
Data preparation
- Data acquisition command
scripts/getdata.py - Market data loading
src/stock_prediction/getdata.py - Preprocessing command
scripts/data_preprocess.py - Data preprocessing
src/stock_prediction/data_preprocess.py - Feature engineering
src/stock_prediction/feature_engineering.py
Forecasting
- Training command
scripts/train.py - Training workflow
src/stock_prediction/train.py - Training engine
src/stock_prediction/trainer.py - Forecast model families
src/stock_prediction/models - Prediction command
scripts/predict.py - Inference workflow
src/stock_prediction/predict.py - Target definition
src/stock_prediction/target.py
Configuration and evaluation
- Application configuration
src/stock_prediction/app_config.py - Diagnostics and metrics
src/stock_prediction/diagnostics.py - Forecast metrics
src/stock_prediction/metrics.py - Shared runtime utilities
src/stock_prediction/common.py
Text classification
- Text data preparation
src/bert/bert_data_preprocess.py - BERT sentiment training
src/bert/bert_train.py
Other components
- Researcher
- Market data APIs
- Data and model artifacts
Connections 27
- Researcher → Data acquisition command: requests data
- Data acquisition command → Market data loading: runs acquisition
- Market data loading → Market data APIs: fetches quotes
- Market data loading → Data and model artifacts: saves data
- Researcher → Preprocessing command: prepares data
- Preprocessing command → Data preprocessing: runs preprocessing
- Data preprocessing → Feature engineering: engineers features
- Data preprocessing → Data and model artifacts: writes processed data
- Researcher → Training command: starts training
- Training command → Training workflow: runs training
- Training workflow → Training engine: delegates training
- Training workflow → Forecast model families: selects model
- Training workflow → Data and model artifacts: saves weights and normalization
- Researcher → Prediction command: requests forecast
- Prediction command → Inference workflow: runs inference
- Inference workflow → Forecast model families: loads model
- Inference workflow → Data and model artifacts: reads data and weights
- Inference workflow → Target definition: uses target definition
- Training workflow → Application configuration: uses settings
- Inference workflow → Application configuration: uses settings
- Training workflow → Diagnostics and metrics: checks training
- Diagnostics and metrics → Forecast metrics: uses metrics
- Researcher → Text data preparation: prepares text data
- Text data preparation → BERT sentiment training: provides prepared data
- BERT sentiment training → Data and model artifacts: saves model
- Market data loading → Shared runtime utilities: uses shared utilities
- Inference workflow → Shared runtime utilities: uses shared utilities