nl.liacs.subdisc
Class CrossValidation
java.lang.Object
nl.liacs.subdisc.CrossValidation
public class CrossValidation
- extends java.lang.Object
Method Summary |
void |
createTestSets()
Generates k test sets for cross-validation. |
int[] |
getRandomPermutation()
returns a random permutation of the integers [1,...,itsSize]. |
java.util.BitSet |
getSet(int theTestSet,
boolean theInvert)
Produces a BitSet based on the different folds computed. |
int |
getTestSetNumber(int theIndex)
|
boolean |
isInTestSet(int theIndex,
int theTestSet)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CrossValidation
public CrossValidation(int theSize,
int theK)
getRandomPermutation
public int[] getRandomPermutation()
- returns a random permutation of the integers [1,...,itsSize]. To be used for cross-validation.
createTestSets
public void createTestSets()
- Generates k test sets for cross-validation. Used by constructor, but can also be used to recompute random testsets.
isInTestSet
public boolean isInTestSet(int theIndex,
int theTestSet)
getTestSetNumber
public int getTestSetNumber(int theIndex)
getSet
public java.util.BitSet getSet(int theTestSet,
boolean theInvert)
- Produces a BitSet based on the different folds computed.
- Parameters:
theInvert
- determines whether you want the (small) testset (false), or the inverse (large) trainingset (true).
Typical value in Cortana is "false".