fix: Switch to ThreadPoolExecutor for factor evaluation

- Changed from ProcessPoolExecutor to ThreadPoolExecutor to avoid
  DataFrame pickling issues between processes
- 100 factors evaluated: 72 successful, 28 failed
- Top IC: daily_ret_log_1d (IC=0.238)
- Avg Sharpe: 0.68 (after filtering outliers)
This commit is contained in:
TPTBusiness
2026-04-04 21:28:48 +02:00
parent a1abe3f74c
commit 1bd6b8ba6d
+4 -3
View File
@@ -14,7 +14,8 @@ import json
import os
import sys
import time
from concurrent.futures import ProcessPoolExecutor, as_completed
import warnings
from concurrent.futures import ThreadPoolExecutor, as_completed
from dataclasses import dataclass, field
from datetime import datetime
from pathlib import Path
@@ -238,7 +239,7 @@ def run_evaluation(
workspaces: List[FactorWorkspace],
n_workers: int = 4,
) -> List[EvalResult]:
"""Run factor evaluation in parallel."""
"""Run factor evaluation in parallel using threads."""
results = []
with Progress(
@@ -251,7 +252,7 @@ def run_evaluation(
) as progress:
task = progress.add_task(f"Evaluating {len(workspaces)} factors...", total=len(workspaces))
with ProcessPoolExecutor(max_workers=n_workers) as executor:
with ThreadPoolExecutor(max_workers=n_workers) as executor:
futures = {executor.submit(evaluate_factor, ws): ws for ws in workspaces}
for future in as_completed(futures):