Class StratifiedCrossValidation

  • All Implemented Interfaces:
    Holdout

    public class StratifiedCrossValidation
    extends AbstractHoldout
    A stratified n-fold crossvalidation to distribute the data to n buckets where each bucket exhibits approximately the same distribution of classes as does the complete data set. The buckets are disjoint. The distribution is deterministic.
    Since:
    0.7.0
    Author:
    Arthur Zimek
    • Field Detail

      • nfold

        protected int nfold
        Holds the number of folds, current fold.
      • fold

        protected int fold
        Holds the number of folds, current fold.
      • assignment

        protected int[] assignment
        Partition assignment, sizes
      • sizes

        protected int[] sizes
        Partition assignment, sizes
    • Constructor Detail

      • StratifiedCrossValidation

        public StratifiedCrossValidation​(int nfold)
        Provides a stratified crossvalidation. Setting parameter N_P to the OptionHandler.
    • Method Detail

      • numberOfPartitions

        public int numberOfPartitions()
        Description copied from interface: Holdout
        How many partitions to test.
        Returns:
        Number of partitions.
      • nextPartitioning

        public TrainingAndTestSet nextPartitioning()
        Description copied from interface: Holdout
        Get the next partitioning of the given holdout.
        Returns:
        Next partitioning of the data set