WalkForwardCV
Ancestors
systematica.walk_forward.base.BaseWalkForwardabc.ABCsystematica.generic.base.Modelsystematica.generic.base.Feature
Descendants
systematica.api.analytics.arbitrage_index.ArbitrageIndexCVsystematica.api.analytics.meta_model.MetaModelCVsystematica.api.analytics.momentum.AverageMomentumFactorCVsystematica.api.analytics.momentum.MomentumFactorCVsystematica.api.analytics.ou_process.OUProcessCVsystematica.api.analytics.range_breakout.RangeBreakoutCVsystematica.api.analytics.volatility.VolatilityFactorCVsystematica.api.analytics.volume_profile.VolumeProfileFactorCV
Static methods
check_is_valid
CV model.
Raises:
| Type | Description |
|---|---|
AttributeError | If the model does not use splitter as a parameter. |
reshape_nested_dataframe
| Name | Type | Default | Description |
|---|---|---|---|
df | pd.DataFrame | -- | The DataFrame to reshape. Must have a MultiIndex with a ‘symbol’ level. |
| Type | Description |
|---|---|
pd.DataFrame | The reshaped DataFrame. |
Instance variables
-
index_train: pandas.core.indexes.base.Index: Computes and returns the train set index of the dataset. The train set index is derived from the end bounds values returned by thesplitter. -
index_test: pandas.core.indexes.base.Index: Computes and returns the test set index of the dataset. The test set index is derived from the end bounds values returned by thesplitter. -
all_portfolio_metrics: List[str]: Get available cross-validation metrics. -
close_reset_stacked_by_set: -
high_reset_stacked_by_set: -
low_reset_stacked_by_set: -
model_output_reset_stacked_by_set: -
open_reset_stacked_by_set: -
preprocess_data_reset_stacked_by_set: -
price_reset_stacked_by_set: -
returns_reset_stacked_by_set: -
split_preprocess_data: -
splitter:
Methods
get_splits
| Type | Description |
|---|---|
pd.DataFrame | DataFrame containing the split data. |
set_index
| Name | Type | Default | Description |
|---|---|---|---|
key | str | -- | If train, extract train-set. If test, extract test-set. |
set_datetime_index | bool | -- | If True, set end-test datetime index. Ignored otherwise. |
| Type | Description |
|---|---|
None | tp.DatetimeIndex | Datetime index. |
signals_reset_stacked_by_set
splitter to reset signals, stacking it by
set and attaching bounds to the index. it then select the test-set.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
validate_model | bool | True | Check if model parameters are valid. Defaults to True. |
| Type | Description |
|---|---|
pd.Series | The signals test-set. |
compare_train_test_split
| Name | Type | Default | Description |
|---|---|---|---|
train_test_stats_config | tp.List[StateConfig] | “None. | State representation config. if None, uses TRAIN_TEST_STATS_CONFIG. Defaults to None. |
| Type | Description |
|---|---|
pd.DataFrame | Computed features. |
get_annualized_return
| Name | Type | Default | Description |
|---|---|---|---|
key | str | test | If train, extract train-set. If test, extract test-set. Defaults to test. |
raw_output | bool | True | If True, returns raw results. Default is True, which returns processed results. |
set_datetime_index | bool | True | If True, set end-test datetime index. Ignored otherwise. Defaults to True. |
| Type | Description |
|---|---|
pd.Series | Series containing the annualized returns for the test set. |
get_portfolio_metrics
| Name | Type | Default | Description |
|---|---|---|---|
metrics | str | -- | | tp.List[str], default None Portfolio performance metrics to compute. If None, uses the default metrics. |
metrics_kwargs | tp.Kwargs | None | Additional keyword arguments for the metrics. |
to_numpy | bool | False | If True, returns a np.ndarray. Default is False, returning a pd.DataFrame. |
validate_model | bool | True | Check if model parameters are valid. Defaults to True. |
portfolio_config | tp.Kwargs | None | Additional configuration for the portfolio simulation. Defaults to None. |
| Type | Description |
|---|---|
pd.DataFrame | tp.Array | Portfolio performance metrics. |

