Use actual plan edge for Entry PM training

This commit is contained in:
Codex
2026-06-28 07:26:59 +08:00
parent 3c0f2d0d91
commit 2a86a6e2fa
6 changed files with 129 additions and 63 deletions
+7
View File
@@ -22,6 +22,7 @@ from trader_training.ofi_feature_experiment import _load_entry_dataset, l1_snaps
from trader_training.promote import promote_artifact_bundle
from trader_training.replay import build_splits
from trader_training.schemas import FEATURE_ORDER, LATEST_STRESS_SPLIT, MODEL_OUTPUTS, OUTPUT_MAPPING, TRAINING_SPLITS, VALIDATION_LOCKED_SPLIT
from trader_training.training import TARGETS
class TrainingContractTest(unittest.TestCase):
@@ -49,6 +50,12 @@ class TrainingContractTest(unittest.TestCase):
self.assertEqual("long_actual_plan_net_edge_bps", _screen_edge_column(dataset, "LONG"))
self.assertEqual("short_actual_plan_net_edge_bps", _screen_edge_column(dataset, "SHORT"))
def test_entry_regression_heads_train_on_actual_plan_edge(self) -> None:
heads = {head[0]: head[2] for head in TARGETS["ENTRY"]["heads"]}
self.assertEqual("long_actual_plan_net_edge_bps", heads["long_expected_net_edge_bps"])
self.assertEqual("short_actual_plan_net_edge_bps", heads["short_expected_net_edge_bps"])
def test_entry_feature_screen_keeps_zero_inflated_event_features(self) -> None:
values = np.concatenate((np.zeros(5000), np.linspace(1.0, 100.0, 500)))
edges = _bucket_edges(values)