28 lines
601 B
Python
28 lines
601 B
Python
|
|
"""训练流程入口脚本
|
|||
|
|
|
|||
|
|
运行方式:
|
|||
|
|
uv run python -m src.training.main
|
|||
|
|
|
|||
|
|
或:
|
|||
|
|
uv run python src/training/main.py
|
|||
|
|
"""
|
|||
|
|
|
|||
|
|
from src.training.pipeline import run_training
|
|||
|
|
|
|||
|
|
|
|||
|
|
if __name__ == "__main__":
|
|||
|
|
# 运行完整训练流程
|
|||
|
|
# 训练集:20180101 - 20230101
|
|||
|
|
# 测试集:20230101 - 20240101
|
|||
|
|
result = run_training(
|
|||
|
|
train_start="20190101",
|
|||
|
|
train_end="20250101",
|
|||
|
|
test_start="20250101",
|
|||
|
|
test_end="20260101",
|
|||
|
|
top_n=5,
|
|||
|
|
output_path="output/top_stocks.tsv",
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
print("\n[Result] Top stocks selection:")
|
|||
|
|
print(result)
|