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: BaseFactorConfig

Config of quantlab.factor.predefined.neutralized.NeutralizedFactor.

factor is the factor whose outputs are neutralized; it keeps its own config, warm-up and store. dataset is the dataset of the exposures, the panel holding size_column and industry_column, or a list of datasets, merged into one MergedDataset as for any factor. Both are component fields, so to_dict() nests their configs and NeutralizedFactor.from_config rebuilds them.

Examples

With alpha a stock alpha factor, daily a Sharadar daily metrics dataset and industry a 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.