Package org.tribuo.regression.example
Class NonlinearGaussianDataSource
java.lang.Object
org.tribuo.regression.example.NonlinearGaussianDataSource
- 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>
public class NonlinearGaussianDataSource
extends Object
implements ConfigurableDataSource<Regressor>
Generates a single dimensional output drawn from
N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance).
The features are drawn from a uniform distribution over the range.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionNonlinearGaussianDataSource
(int numSamples, float[] weights, float intercept, float variance, float xZeroMin, float xZeroMax, float xOneMin, float xOneMax, long seed) Generates a single dimensional output drawn from N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance).NonlinearGaussianDataSource
(int numSamples, long seed) Generates a single dimensional output drawn from N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance). -
Method Summary
Modifier and TypeMethodDescriptionstatic MutableDataset<Regressor>
generateDataset
(int numSamples, float[] weights, float intercept, float variance, float xZeroMin, float xZeroMax, float xOneMin, float xOneMax, long seed) Generates a single dimensional output drawn from N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance).Returns the OutputFactory associated with this Output subclass.iterator()
void
Used 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, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
NonlinearGaussianDataSource
public NonlinearGaussianDataSource(int numSamples, long seed) Generates a single dimensional output drawn from N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance).The weights are
[1,1,1,1]
, the intercept is 0, and the variance is 1.0. The features are drawn from a uniform distribution over the range[-2,2]
.- Parameters:
numSamples
- The size of the created datasource.seed
- The rng seed to use.
-
NonlinearGaussianDataSource
public NonlinearGaussianDataSource(int numSamples, float[] weights, float intercept, float variance, float xZeroMin, float xZeroMax, float xOneMin, float xOneMax, long seed) Generates a single dimensional output drawn from N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance).The features are drawn from a uniform distribution over the range.
- Parameters:
numSamples
- The size of the created datasource.weights
- The feature weights.intercept
- The y intercept of the line.variance
- The variance of the gaussian.xZeroMin
- The minimum x_0 value (inclusive).xZeroMax
- The maximum x_0 value (exclusive).xOneMin
- The minimum x_1 value (inclusive).xOneMax
- The maximum x_1 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:
postConfig
in interfacecom.oracle.labs.mlrg.olcut.config.Configurable
-
getOutputFactory
Description copied from interface:DataSource
Returns the OutputFactory associated with this Output subclass.- Specified by:
getOutputFactory
in interfaceDataSource<Regressor>
- Returns:
- The output factory.
-
getProvenance
- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>
-
iterator
-
generateDataset
public static MutableDataset<Regressor> generateDataset(int numSamples, float[] weights, float intercept, float variance, float xZeroMin, float xZeroMax, float xOneMin, float xOneMax, long seed) Generates a single dimensional output drawn from N(w_0*x_0 + w_1*x_1 + w_2*x_1*x_0 + w_3*x_1*x_1*x_1 + intercept,variance).The features are drawn from a uniform distribution over the range.
- Parameters:
numSamples
- The size of the output dataset.weights
- The feature weights.intercept
- The y intercept of the line.variance
- The variance of the gaussian.xZeroMin
- The minimum x_0 value (inclusive).xZeroMax
- The maximum x_0 value (exclusive).xOneMin
- The minimum x_1 value (inclusive).xOneMax
- The maximum x_1 value (exclusive).seed
- The rng seed to use.- Returns:
- A dataset drawn from a gaussian.
-