quantlab.factor.config.NeutralizedConfig#
- class quantlab.factor.config.NeutralizedConfig(*, warmup_bars=0, dataset, file_path=None, factor_names=None, kwargs=None, resample_freq=None, resample_how=None, name=None, factor, size_column='marketcap', industry_column='industry', regressors=('industry', 'size'), njobs=128)[source]#
Bases:
BaseFactorConfigConfig of
quantlab.factor.predefined.neutralized.NeutralizedFactor.factoris the factor whose outputs are neutralized; it keeps its own config, warm-up and store.datasetis the dataset of the exposures, the panel holdingsize_columnandindustry_column, or a list of datasets, merged into oneMergedDatasetas for any factor. Both are component fields, soto_dict()nests their configs andNeutralizedFactor.from_configrebuilds them.Examples
With
alphaa stock alpha factor,dailya Sharadar daily metrics dataset andindustrya Sharadar industry dataset:>>> cfg = NeutralizedConfig(factor=alpha, dataset=[daily, industry]) >>> cfg.regressors, cfg.size_column, cfg.warmup_bars (('industry', 'size'), 'marketcap', 0)
- factor#
The factor whose outputs are neutralized.
- industry_column = 'industry'#
Exposure variable holding the integer industry code.
- njobs = 128#
Threads used by the KunQuant executor.
- regressors = ('industry', 'size')#
What the outputs are neutralized against:
"industry","size"or both.
- size_column = 'marketcap'#
Exposure variable holding the market cap; its log is the size regressor.
- warmup_bars = 0#
Neutralization looks at one bar at a time, so it reads no history; the wrapped factor warms itself up. Anything but 0 is refused.