Combinatorial
PortfolioOptimisers.CombinatorialCrossValidation Type
struct CombinatorialCrossValidation{T1, T2, T3, T4} <: NonSequentialCrossValidationEstimator
n_folds::T1
n_test_folds::T2
purged_size::T3
embargo_size::T4
endImplements combinatorial non-sequential cross-validation with purging and embargoing, allowing for all possible combinations of test folds.
Fields
n_folds: Number of folds to split the data into.n_test_folds: Number of folds to use as test set in each split.purged_size: Number of observations to exclude from the start/end of each train set adjacent to a test set.embargo_size: Number of observations to exclude from the start of each train set after a test set.
Constructors
CombinatorialCrossValidation(; n_folds::Integer = 10, n_test_folds::Integer = 8,
purged_size::Integer = 0, embargo_size::Integer = 0,
warn_comb::Integer = 100_000)Keyword arguments correspond to the fields above.
Validation
n_foldsmust be non-empty, greater than zero, and finite.n_test_foldsmust be non-empty, greater than zero, and finite.purged_sizeandembargo_sizemust be non-empty and finite.Warns if the number of combinations exceeds
warn_comb.
Examples
julia> CombinatorialCrossValidation(; n_folds = 10, n_test_folds = 8, purged_size = 2,
embargo_size = 1)
CombinatorialCrossValidation
n_folds ┼ Int64: 10
n_test_folds ┼ Int64: 8
purged_size ┼ Int64: 2
embargo_size ┴ Int64: 1Related
[
NonSequentialCrossValidationEstimator]-(@ref)[
CombinatorialCrossValidationResult]-(@ref)[
split]-(@ref)[
n_splits]-(@ref)