public class FeatureInitializerFactory extends Object
Modifier and Type | Method and Description |
---|---|
static FeatureInitializer |
function(UnivariateFunction f,
double init,
double inc)
Creates an initializer from a univariate function
f(x) . |
static FeatureInitializer |
randomize(RealDistribution random,
FeatureInitializer orig)
Adds some amount of random data to the given initializer.
|
static FeatureInitializer |
uniform(double min,
double max)
Uniform sampling of the given range.
|
static FeatureInitializer |
uniform(RandomGenerator rng,
double min,
double max)
Uniform sampling of the given range.
|
public static FeatureInitializer uniform(RandomGenerator rng, double min, double max)
min
- Lower bound of the range.max
- Upper bound of the range.rng
- Random number generator used to draw samples from a
uniform distribution.NumberIsTooLargeException
- if min >= max
.public static FeatureInitializer uniform(double min, double max)
min
- Lower bound of the range.max
- Upper bound of the range.NumberIsTooLargeException
- if min >= max
.public static FeatureInitializer function(UnivariateFunction f, double init, double inc)
f(x)
.
The argument x
is set to init
at the first call
and will be incremented at each call.f
- Function.init
- Initial value.inc
- Incrementpublic static FeatureInitializer randomize(RealDistribution random, FeatureInitializer orig)
random
- Random variable distribution.orig
- Original initializer.value
method will return orig.value() + random.sample()
.Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.