Tiny sandbox for experimenting with stock-price forecasting using engineered technical features and a basic PyTorch MLP.
- Data: CSVs in
data/(e.g.,nasdaq_19900101_20230630.csv) with OHLCV columns andDateindex. - Features: Rolling means/std devs, volume ratios, and lagged returns built via
prepare_data_featuresinhelpers.py. - Model:
NasdaqBasicMLPRunnerinnasdaq_basic_mlp.pytrains a 2-layer MLP on standardized features and reports MSE/MAE/R².
uv sync # creates .venv and installs deps from uv.lock/pyproject.toml
uv run nasdaq_basic_mlp.py # trains and prints test metrics
- Ensure rsync is installed:
apt update && apt install rsync -y - Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh - Sync project to remote host:
bin/rspec 1.1.1.1:22 /workspace(/workspaceis implied/default) - SSH into remote host and run:
cd /workspace && uv sync && uv run python nasdaq_basic_mlp.py
- Build:
docker build -t explore-stock-analysis:latest . - Run (NVIDIA):
docker run --rm --gpus all explore-stock-analysis:latest
- Adjust train/test splits, learning rate, or epochs in the
NasdaqBasicMLPRunnerconstructor. - Swap
data/*.csvor add new ones; filenames map toload_stock_data("<name>")without the.csvsuffix.