Class GaussianLabelDataSource
java.lang.Object
org.tribuo.classification.example.DemoLabelDataSource
org.tribuo.classification.example.GaussianLabelDataSource
- 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>
A data source for two classes generated from separate Gaussians.
-
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
ConstructorDescriptionGaussianLabelDataSource
(int numSamples, long seed, double[] firstMean, double[] firstCovarianceMatrix, double[] secondMean, double[] secondCovarianceMatrix) Constructs a data source which contains two classes where each class is sampled from a 2d Gaussian with the specified parameters. -
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
-
GaussianLabelDataSource
public GaussianLabelDataSource(int numSamples, long seed, double[] firstMean, double[] firstCovarianceMatrix, double[] secondMean, double[] secondCovarianceMatrix) Constructs a data source which contains two classes where each class is sampled from a 2d Gaussian with the specified parameters.- Parameters:
numSamples
- The number of samples to draw.seed
- The RNG seed.firstMean
- The mean of class one's Gaussian.firstCovarianceMatrix
- The covariance matrix of class one's Gaussian.secondMean
- The mean of class two's Gaussian.secondCovarianceMatrix
- The covariance matrix of class two's Gaussian.
-
-
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
-