quantlab.model.walk_forward_training.WalkForwardTrainable#

class quantlab.model.walk_forward_training.WalkForwardTrainable(*args, **kwargs)[source]#

Bases: Protocol

What train_walk_forward needs from the unit it trains; all public.

Attributes:
class_namestr

Names the trial directory, the summary run and error messages.

model_save_dirPath

The directory the trial directory is created in.

purge_barsint

Bars each fold’s training window loses (an ensemble’s: the largest over its members).

trackerTracker

The tracker the CV summary run is opened through (an ensemble’s: its first member’s).

tracking_projectstr

The default project of that run.

Examples

>>> isinstance(model, WalkForwardTrainable), isinstance(ensemble, WalkForwardTrainable)
(True, True)
check_hyperparameters()[source]#

Raise ValueError if a hyperparameter is invalid.

get_config()[source]#

The unit’s config, the summary run’s config.

provenance()[source]#

What the walk-forward run records about the data and code trained on.

train_fold(fold, run_dir, group)[source]#

Train on fold’s dates into run_dir, then restore the unit’s own dates.

walk_forward_bars()[source]#

The collected bars between the unit’s start and end dates, maybe none.