Record Class WalkForwardSpec
- Record Components:
folds- how many sequential optimize-then-score windows to run. Two is the floor and the reason is structural rather than a tuning preference: parameter drift is measured between consecutive fold winners, and a single fold has no consecutive pair, so it would report the strongest possible stability having measured nothing. The ceiling is a platform setting; exceeding it is rejected.inSamplePct- share of each fold's window spent optimizing, the rest being where its winner is scored.nulltakes the platform default. Lower values leave more data to score on and, on short sessions, are what let the requested fold count tile the data at all.
Attaching this changes what the sweep does, not just how much of it runs. Instead of scoring every parameter vector once over the whole range, the data is cut into sequential folds; each fold optimizes the whole grid on its own window and then scores only its winner on the window immediately after — data that winner was never chosen on. The question it answers is not "which parameters won" but "does re-optimizing this periodically actually work".
Omit it and nothing about the sweep changes, including the shape of the response.
It costs folds × grid. Four folds over a 500-point grid is roughly 2000 backtests where the plain sweep is 500, which is why it is opt-in. The platform rejects the request outright when that product exceeds its sweep budget.
It is a different sweep, not a variant of one. Two requests that differ only in this block do not deduplicate against each other.
The answer arrives as ExecuteSweepResult.getWalkForward() — see
WalkForwardResult and Sweep.await() for how to read it.
-
Constructor Summary
ConstructorsConstructorDescriptionWalkForwardSpec(int folds, Integer inSamplePct) Creates an instance of aWalkForwardSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intfolds()Returns the value of thefoldsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinSamplePctrecord component.static WalkForwardSpecof(int folds) Walk forward over the given number of folds, leaving the in-sample share to the platform default.static WalkForwardSpecof(int folds, int inSamplePct) Walk forward over the given number of folds with an explicit in-sample share.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
WalkForwardSpec
Creates an instance of aWalkForwardSpecrecord class.- Parameters:
folds- the value for thefoldsrecord componentinSamplePct- the value for theinSamplePctrecord component
-
-
Method Details
-
of
Walk forward over the given number of folds, leaving the in-sample share to the platform default.- Parameters:
folds- how many sequential optimize-then-score windows to run; at least 2- Returns:
- the spec
-
of
Walk forward over the given number of folds with an explicit in-sample share.- Parameters:
folds- how many sequential optimize-then-score windows to run; at least 2inSamplePct- share of each fold spent optimizing, within 10..90- Returns:
- the spec
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
folds
public int folds()Returns the value of thefoldsrecord component.- Returns:
- the value of the
foldsrecord component
-
inSamplePct
Returns the value of theinSamplePctrecord component.- Returns:
- the value of the
inSamplePctrecord component
-