Class GaussianDataSource
java.lang.Object
org.tribuo.regression.example.GaussianDataSource
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>,Iterable<Example<Regressor>>,ConfigurableDataSource<Regressor>,DataSource<Regressor>
Generates a single dimensional output drawn from N(slope*x + intercept,variance).
The single feature is drawn from a uniform distribution over the range.
Set slope to zero to draw from a gaussian.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionGaussianDataSource(int numSamples, float slope, float intercept, float variance, float xMin, float xMax, long seed) Generates a single dimensional output drawn from N(slope*x + intercept,variance). -
Method Summary
Modifier and TypeMethodDescriptiongenerateDataset(int numSamples, float slope, float intercept, float variance, float xMin, float xMax, long seed) Generates a single dimensional output drawn from N(slope*x + intercept,variance).Returns the OutputFactory associated with this Output subclass.iterator()voidUsed by the OLCUT configuration system, and should not be called by external code.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GaussianDataSource
public GaussianDataSource(int numSamples, float slope, float intercept, float variance, float xMin, float xMax, long seed) Generates a single dimensional output drawn from N(slope*x + intercept,variance).The single feature is drawn from a uniform distribution over the range.
Set slope to zero to draw from a gaussian.
- Parameters:
numSamples- The size of the output dataset.slope- The slope of the line.intercept- The y intercept of the line.variance- The variance of the gaussian.xMin- The minimum x value (inclusive).xMax- The maximum x value (exclusive).seed- The rng seed to use.
-
-
Method Details
-
postConfig
public void postConfig()Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
postConfigin interfacecom.oracle.labs.mlrg.olcut.config.Configurable
-
getOutputFactory
Description copied from interface:DataSourceReturns the OutputFactory associated with this Output subclass.- Specified by:
getOutputFactoryin interfaceDataSource<Regressor>- Returns:
- The output factory.
-
getProvenance
- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>
-
iterator
-
generateDataset
public static Dataset<Regressor> generateDataset(int numSamples, float slope, float intercept, float variance, float xMin, float xMax, long seed) Generates a single dimensional output drawn from N(slope*x + intercept,variance).The single feature is drawn from a uniform distribution over the range.
Set slope to zero to draw from a gaussian.
- Parameters:
numSamples- The size of the output dataset.slope- The slope of the line.intercept- The y intercept of the line.variance- The variance of the gaussian.xMin- The minimum x value (inclusive).xMax- The maximum x value (exclusive).seed- The rng seed to use.- Returns:
- A dataset drawn from a gaussian.
-