Class MultilabelDatasetSplitter


  • public class MultilabelDatasetSplitter
    extends java.lang.Object
    This class provides methods to obtain train and test splits for a given data set and split technique.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getSplitTechniqueAndDetailsSeparator()
      Obtain the token used to separate a split technique and the details about the split.
      static weka.core.Instances getTestSplit​(weka.core.Instances data, java.lang.String splitDescription, java.lang.String testFold, java.lang.String seed)
      Split the Instances object according to the given splitDescription.
      static weka.core.Instances getTrainSplit​(weka.core.Instances data, java.lang.String splitDescription, java.lang.String testFold, java.lang.String seed)
      Split the Instances object according to the given splitDescription.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getTestSplit

        public static weka.core.Instances getTestSplit​(weka.core.Instances data,
                                                       java.lang.String splitDescription,
                                                       java.lang.String testFold,
                                                       java.lang.String seed)
        Split the Instances object according to the given splitDescription. The splitDescription is composed of the used technique and details about the split for the used technique separated by special token obtainable by getSplitTechniqueAndDetailsSeparator(). The returned data will only contain the testFold. The seed is given to the technique if it uses a seed.
        Parameters:
        data - The data to extract a test fold from
        splitDescription - The description of how the split shall be performed
        testFold - The number of the fold to be extracted (0...n)
        seed - The random seed to be used by the technique
        Returns:
        The test fold
      • getTrainSplit

        public static weka.core.Instances getTrainSplit​(weka.core.Instances data,
                                                        java.lang.String splitDescription,
                                                        java.lang.String testFold,
                                                        java.lang.String seed)
        Split the Instances object according to the given splitDescription. The splitDescription is composed of the used technique and details about the split for the used technique separated by a special token obtainable by getSplitTechniqueAndDetailsSeparator(). The returned data will not contain the testFold. The seed is given to the technique if it uses a seed.
        Parameters:
        data - The data to extract a train fold from
        splitDescription - The description of how the split shall be performed
        testFold - The number of the fold to be excluded (0..n)
        seed - The random seed to be used by the technique
        Returns:
        The train fold
      • getSplitTechniqueAndDetailsSeparator

        public static java.lang.String getSplitTechniqueAndDetailsSeparator()
        Obtain the token used to separate a split technique and the details about the split.
        Returns:
        The separator token