Class DemoLabelDataSource
java.lang.Object
org.tribuo.classification.example.DemoLabelDataSource
- 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>
- Direct Known Subclasses:
CheckerboardDataSource
,ConcentricCirclesDataSource
,GaussianLabelDataSource
,InterlockingCrescentsDataSource
,NoisyInterlockingCrescentsDataSource
The base class for the 2d binary classification data sources in
org.tribuo.classification.example
.
The feature names are X1
and X2
and the labels are FIRST_CLASS
and SECOND_CLASS
.
Likely to be sealed to the classes in this package when we adopt Java 17.
-
Field Details
-
factory
-
X1
The first feature name.- See Also:
-
X2
The second feature name.- See Also:
-
FIRST_CLASS
The first class. -
SECOND_CLASS
The second class. -
numSamples
@Config(mandatory=true, description="Number of samples to generate.") protected int numSamples -
seed
@Config(mandatory=true, description="RNG seed.") protected long seed -
rng
-
examples
-
-
Method Details
-
postConfig
public void postConfig()Configures the class. Should be called in sub-classes' postConfigs after they've validated their parameters.- Specified by:
postConfig
in interfacecom.oracle.labs.mlrg.olcut.config.Configurable
-
generate
Generates the examples using the configured fields.Is called internally by
postConfig()
.- Returns:
- The generated examples.
-
getOutputFactory
Description copied from interface:DataSource
Returns the OutputFactory associated with this Output subclass.- Specified by:
getOutputFactory
in interfaceDataSource<Label>
- Returns:
- The output factory.
-
getProvenance
- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>
-
iterator
-