This commit is contained in:
2026-08-29 11:00:27 +08:00
parent c0df80154b
commit 9e1b5e251a
11 changed files with 55 additions and 33 deletions

View File

@@ -8,10 +8,10 @@
- Python 3 和本项目的虚拟环境;
- `pandas`、`numpy`、`scikit-learn`、`joblib` 等项目依赖;
- Go 和 `/home/ctyun/ban/banbot` 源码;
- Go 和 `/data/ban/banbot` 源码;
- banbot 配置中的 QuestDB 数据库,以及对 Binance 数据的访问。
默认配置文件是 `/home/ctyun/ban/banbot/biz/config.yml`。如果路径不同,可通过 `--banbot-config` 和 `--banbot-dir` 覆盖。也可以直接传入 `--dsn`。
默认配置文件是 `/data/ban/banbot/biz/config.yml`。如果路径不同,可通过 `--banbot-config` 和 `--banbot-dir` 覆盖。也可以直接传入 `--dsn`。
安装:
@@ -34,7 +34,7 @@ python3 -m venv .venv
4. 调用 banbot 导出请求周期的完整 K 线;默认是 8H,也可以通过 `--timeframe 1d` 导出日线。
5. 写入 `data/manifest.json` 和 `data/raw/*.csv`。
6. 加载 `artifacts/v1/model.joblib`,对清单中的每个品种使用最新完整 8H K 线预测。
7. 按最新 8H USDT 成交额降序写入 `predictions/latest_v1/predictions.csv`,并写入 `report.json`。
7. 按最新 8H USDT 成交额降序写入 `predictions/latest_v1_8h/predictions.csv`,并写入 `report.json`。
脚本的默认参数可以覆盖:
@@ -44,7 +44,7 @@ python3 -m venv .venv
--banbot-config /path/to/config.yml \
--data-dir data \
--artifact artifacts/v1/model.joblib \
--output-dir predictions/latest_v1 \
--output-dir predictions/latest_v1_8h \
--end 2026-08-23T00:00:00Z
```
@@ -56,7 +56,7 @@ python3 -m venv .venv
```bash
.venv/bin/python -m cbpred prepare \
--banbot-config /home/ctyun/ban/banbot/biz/config.yml \
--banbot-config /data/ban/banbot/biz/config.yml \
--out-dir data
```
@@ -64,7 +64,7 @@ python3 -m venv .venv
```bash
.venv/bin/python -m cbpred prepare \
--banbot-config /home/ctyun/ban/banbot/biz/config.yml \
--banbot-config /data/ban/banbot/biz/config.yml \
--out-dir data \
--skip-download
```
@@ -77,7 +77,7 @@ python3 -m venv .venv
.venv/bin/python -m cbpred prepare \
--timeframe 1d \
--out-dir data_1d \
--banbot-config /home/ctyun/ban/banbot/biz/config.yml
--banbot-config /data/ban/banbot/biz/config.yml
```
### 训练模型
@@ -121,7 +121,7 @@ cbpred/
├── artifacts/
│ └── v1/ # 唯一正式模型版本
└── predictions/
└── latest_v1/ # 最近一次批量预测
└── latest_v1_8h/ # 最近一次 8H 批量预测
```
模型版本目录使用 `v1` 形式维护。历史实验可以保留在文档或实验输出目录中,但不应作为默认预测模型或在项目根目录新增多个 `artifacts_*` 入口。