quantlab.model.walk_forward_training.fold_config#

quantlab.model.walk_forward_training.fold_config(config, fold)[source]#

Return config with fold’s training window before the purge and its test window.

A model given these dates purges the training window itself.

Parameters:
configdataclass

A model config with train_start, train_end, test_start and test_end.

foldFold

The fold whose dates to apply.

Returns:
dataclass

A copy of config; config is not modified.

Examples

>>> fold = Fold(0, ("2024-01-01", "2024-01-10"), ("2024-01-01", "2024-01-08"),
...             ("2024-01-11", "2024-01-12"))
>>> fold_config(model.config, fold).test_start
'2024-01-11'