Package org.tribuo.multilabel.example
Class MultiLabelDataGenerator
java.lang.Object
org.tribuo.multilabel.example.MultiLabelDataGenerator
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 Summary
Modifier and TypeMethodDescriptionstatic Example<MultiLabel>
Generates an example with no features.static com.oracle.labs.mlrg.olcut.util.Pair<Dataset<MultiLabel>,
Dataset<MultiLabel>> Generate training and testing datasets.static Dataset<MultiLabel>
Simple test data for checking multi-label trainers.static Dataset<MultiLabel>
Simple training data for checking multi-label trainers.static Example<MultiLabel>
Generates an example with the feature ids 1,5,8, which does not intersect with the ids used elsewhere in this class.
-
Method Details
-
generateTrainData
Simple training data for checking multi-label trainers.- Returns:
- Simple 3 class training data.
-
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
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
Generates an example with no features.- Returns:
- An example with no features.
-