Class CheckerboardDataSource
java.lang.Object
org.tribuo.classification.example.DemoLabelDataSource
org.tribuo.classification.example.CheckerboardDataSource
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>
,Iterable<Example<Label>>
,ConfigurableDataSource<Label>
,DataSource<Label>
Creates a data source using a 2d checkerboard of alternating classes.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.tribuo.classification.example.DemoLabelDataSource
DemoLabelDataSource.DemoLabelDataSourceProvenance
-
Field Summary
Fields inherited from class org.tribuo.classification.example.DemoLabelDataSource
examples, factory, FIRST_CLASS, numSamples, rng, SECOND_CLASS, seed, X1, X2
-
Constructor Summary
ConstructorDescriptionCheckerboardDataSource
(int numSamples, long seed, int numSquares, double min, double max) Creates a checkboard with the required number of squares per dimension, where each feature value lies between min and max. -
Method Summary
Methods inherited from class org.tribuo.classification.example.DemoLabelDataSource
getOutputFactory, getProvenance, iterator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CheckerboardDataSource
public CheckerboardDataSource(int numSamples, long seed, int numSquares, double min, double max) Creates a checkboard with the required number of squares per dimension, where each feature value lies between min and max.- Parameters:
numSamples
- The number of samples to generate.seed
- The RNG seed.numSquares
- The number of squares.min
- The minimum feature value.max
- The maximum feature value.
-
-
Method Details
-
postConfig
public void postConfig()Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
postConfig
in interfacecom.oracle.labs.mlrg.olcut.config.Configurable
- Overrides:
postConfig
in classDemoLabelDataSource
-
generate
Description copied from class:DemoLabelDataSource
Generates the examples using the configured fields.Is called internally by
DemoLabelDataSource.postConfig()
.- Specified by:
generate
in classDemoLabelDataSource
- Returns:
- The generated examples.
-
toString
-