quantlab.portfolio.config.TopNConfig#
- class quantlab.portfolio.config.TopNConfig(direction, top_n, score_label=None)[source]#
Bases:
FrozenConfigConfig of
TopNConstructor: equal-weight top-n selection.Examples
>>> cfg = TopNConfig(direction="long_short", top_n=20) >>> cfg.score_label is None True
- direction#
"long_only"holds the toptop_nnames;"long_short"also shorts the bottomtop_n, with the two books disjoint.
- score_label = None#
The label whose prediction ranks the symbols.
Noneselects the predictor’s first label.
- top_n#
Number of names selected per book at every rebalance.