Chapter 4 Baseline Codebase
This repository is a cleaned baseline-only snapshot for the ten runs used in Chapter 4 of the thesis.
It intentionally excludes the later improvement experiments: discrete target states, Top-K shortlist, frequency experiments, simulated improvement results, and majority voting.
Contents
- Baseline source code exported from commit
3c05c1afb50afa4734296fce18cc77c776f79c1d. - The ten historical Chapter 4 W&B ids and setup metadata in
scripts/baseline_runs.json. - A single-run entrypoint:
run.sh. - A ten-run launcher with the same baseline setup as the selected original
runs:
launch.sh. - Local reusable market/news input data packaged as
assets/ch4_baseline_local_data.zip.
The raw local data directories are ignored by git after extraction:
stockbench/storage/parquet/
stockbench/storage/cache/news/
stockbench/storage/cache/news_by_day/
stockbench/storage/cache/financials/
stockbench/storage/cache/corporate_actions/
stockbench/storage/cache/stock_indicators/
Old LLM response caches, generated backtest reports, and local W&B outputs are not included.
Setup
Clone the Hugging Face dataset repository:
git clone https://huggingface.co/datasets/stock-agent/chapter4-baseline-clean
cd chapter4-baseline-clean
Restore local price/news data:
unzip -q assets/ch4_baseline_local_data.zip -d .
Data archive checksum:
sha256 3fb0ccdf05aacfeef15c032aa62b956aa6a22a247a0b56145e54b30ea7ce6dbf
Create the conda environment:
conda env create -f environment.yml
conda activate stockagent
Configure the LLM API key. The original runs used the qingyuntop
OpenAI-compatible profile. No API key is included in this repository.
export QINGYUNTOP_API_KEY="your key"
Optional W&B configuration:
export WANDB_MODE=offline # default
# export WANDB_MODE=online # upload new runs to W&B
Run
Run one baseline:
MODEL=deepseek-v3.1 RUN_PREFIX=DEEPSEEK_V3_1 ./run.sh
Run the ten Chapter 4 baseline setups:
./launch.sh
By default, run.sh uses:
START=2025-03-01
END=2026-02-28
PROFILE=qingyuntop
NEWS_ENABLED=true
DATA_MODE=offline_only
CACHE_MODE=llm_write_only
WANDB_MODE=offline
Reproduction Notes
The manifest records the original W&B ids and original code commit for each
selected run. launch.sh does not force those old W&B ids; it runs the same
baseline setup and lets the current run generate fresh timestamped ids.
The packaged local input data contains:
parquet: 13440 files
cache/news: 5585 files
cache/news_by_day: 6010 files
cache/financials: 63 files
cache/corporate_actions: 42 files
cache/stock_indicators: 6783 files