Class MultiLabelDataGenerator

java.lang.Object
org.tribuo.multilabel.example.MultiLabelDataGenerator

public class MultiLabelDataGenerator extends Object
Generates three example train and test datasets, used for unit testing. They don't necessarily have sensible classification boundaries, it's for testing the machinery rather than accuracy.
  • Method Details

    • generateTrainData

      public static Dataset<MultiLabel> generateTrainData()
      Simple training data for checking multi-label trainers.
      Returns:
      Simple 3 class training data.
    • generateTestData

      public static Dataset<MultiLabel> generateTestData()
      Simple test data for checking multi-label trainers.
      Returns:
      Simple 3 class test data.
    • generateDataset

      public static com.oracle.labs.mlrg.olcut.util.Pair<Dataset<MultiLabel>,Dataset<MultiLabel>> generateDataset()
      Generate training and testing datasets.
      Returns:
      A pair of datasets.
    • invalidSparseExample

      public static Example<MultiLabel> invalidSparseExample()
      Generates an example with the feature ids 1,5,8, which does not intersect with the ids used elsewhere in this class. This should make the example empty at prediction time.
      Returns:
      An example with features {1:1.0,5:5.0,8:8.0}.
    • emptyExample

      public static Example<MultiLabel> emptyExample()
      Generates an example with no features.
      Returns:
      An example with no features.