microsoft / qlib

Qlib is an AI-oriented quantitative investment platform that aims to realize the potential, empower research, and create value using AI technologies in quantitative investment, from exploring ideas to implementing productions. Qlib supports diverse machine learning modeling paradigms. including supervised learning, market dynamics modeling, and RL.
https://qlib.readthedocs.io/en/latest/
MIT License
15.26k stars 2.61k forks source link

port_analysis_config中strategy下kwarg的signal问题 #1795

Open semiparametric opened 4 months ago

semiparametric commented 4 months ago

在benchmark文件夹下面,模型对应的yaml配置文件中,一般使用signal port_analysis_config: &port_analysis_config strategy: class: TopkDropoutStrategy module_path: qlib.contrib.strategy kwargs: signal: “PRED” topk: 50 n_drop: 5 在workflow__by_code.py中,使用signal": (model, dataset)。 port_analysis_config = {..... "strategy": { "class": "TopkDropoutStrategy", "module_path": "qlib.contrib.strategy.signal_strategy", "kwargs": { "signal": (model, dataset), "topk": 50, "n_drop": 5, }, },

问题是"PRED"(应该是《PRED》)中的pred是什么定义,没有看到相关说明?然后就是这两种方式有什么区别,谢谢大佬们。

akazeakari commented 3 months ago

\是一个占位符(placeholder),它会被函数fill_placeholder替换为模型的prediction scores,交易策略会根据这些预测得分来选择和排序股票,然后决定买卖哪些股票以及买卖的数量。用例