feat(core): add PoolConfig dataclass for pool strategy configuration
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path as _Path
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -55,3 +56,36 @@ class GeneratedQuestion:
|
||||
difficulty: str
|
||||
skill_target: str | None = field(default=None)
|
||||
difficulty_steps: int | None = field(default=None)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class PoolConfig:
|
||||
"""池构建策略的统一配置。
|
||||
|
||||
两组字段由两个具体策略各取所需,未使用的字段被忽略。
|
||||
|
||||
属性:
|
||||
task_types: 限定题型元组;None 表示全部类别。
|
||||
seed: 随机种子,保证可复现。
|
||||
baseline_run_id: 基线 run 标识。
|
||||
diag_size: 诊断池大小(GlobalStrategy 用)。
|
||||
diag_correct_ratio: 诊断池中对题占比(GlobalStrategy 用)。
|
||||
val_size: 验证池大小(GlobalStrategy 用)。
|
||||
val_correct_ratio: 验证池中对题占比(GlobalStrategy 用)。
|
||||
test_size: held-out 测试池大小(GlobalStrategy 用)。
|
||||
eval_min_per_class: 验证池中每类保底样本数(GlobalStrategy 用)。
|
||||
train_ratio: train/(train+val) 比例(PerCategoryStrategy 用)。
|
||||
test_questions_dir: 外部 test 题源路径(PerCategoryStrategy 用)。
|
||||
"""
|
||||
|
||||
task_types: tuple[str, ...] | None
|
||||
seed: int
|
||||
baseline_run_id: str
|
||||
diag_size: int
|
||||
diag_correct_ratio: float
|
||||
val_size: int
|
||||
val_correct_ratio: float
|
||||
test_size: int
|
||||
eval_min_per_class: int
|
||||
train_ratio: float
|
||||
test_questions_dir: _Path | None
|
||||
|
||||
Reference in New Issue
Block a user