Record Class PurgedKFold.Split
java.lang.Object
java.lang.Record
com.quantfinlib.backtest.validation.PurgedKFold.Split
- Enclosing class:
PurgedKFold
public static record PurgedKFold.Split(int fold, int testFrom, int testTo, int[] trainIndices)
extends Record
One fold: test on
[testFrom, testTo), train on
trainIndices (ascending, purged and embargoed).-
Constructor Summary
ConstructorsConstructorDescriptionSplit(int fold, int testFrom, int testTo, int[] trainIndices) Creates an instance of aSplitrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intfold()Returns the value of thefoldrecord component.final inthashCode()Returns a hash code value for this object.inttestFrom()Returns the value of thetestFromrecord component.inttestTo()Returns the value of thetestTorecord component.final StringtoString()Returns a string representation of this record class.int[]Returns the value of thetrainIndicesrecord component.
-
Constructor Details
-
Split
public Split(int fold, int testFrom, int testTo, int[] trainIndices) Creates an instance of aSplitrecord class.- Parameters:
fold- the value for thefoldrecord componenttestFrom- the value for thetestFromrecord componenttestTo- the value for thetestTorecord componenttrainIndices- the value for thetrainIndicesrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
fold
public int fold()Returns the value of thefoldrecord component.- Returns:
- the value of the
foldrecord component
-
testFrom
public int testFrom()Returns the value of thetestFromrecord component.- Returns:
- the value of the
testFromrecord component
-
testTo
public int testTo()Returns the value of thetestTorecord component.- Returns:
- the value of the
testTorecord component
-
trainIndices
public int[] trainIndices()Returns the value of thetrainIndicesrecord component.- Returns:
- the value of the
trainIndicesrecord component
-