quantlab.portfolio.config.TopkDropoutConfig#
- class quantlab.portfolio.config.TopkDropoutConfig(direction, topk, n_drop, score_label=None)[source]#
Bases:
FrozenConfigConfig of
TopkDropoutConstructor: qlib’s TopkDropout.Examples
>>> cfg = TopkDropoutConfig(direction="long_only", topk=50, n_drop=5) >>> cfg.score_label is None True
- direction#
"long_only"holdstopknames;"long_short"also holdstopkshorts, the short side mirrored, the two books disjoint.
- n_drop#
Most holdings replaced per book at a rebalance.
- score_label = None#
The label whose prediction ranks the symbols.
Noneselects the predictor’s first label.
- topk#
Number of names held per book.