public final class SimpleTransform extends Object implements Transformer, Transformation, TransformStatistics
It's a Transformation, Transformer and TransformStatistics as it has no data dependent state. This means a single Transformer can be used for every feature in a dataset.
Wraps a DoubleUnaryOperator
which actually performs the
transformation.
Modifier and Type | Class and Description |
---|---|
static class |
SimpleTransform.Operation
Operations understood by this Transformation.
|
static class |
SimpleTransform.SimpleTransformProvenance
Provenance for
SimpleTransform . |
Modifier and Type | Field and Description |
---|---|
static double |
EPSILON |
Modifier and Type | Method and Description |
---|---|
static SimpleTransform |
add(double operand)
Generate a SimpleTransform that
adds the operand to each value.
|
static SimpleTransform |
binarise()
Generate a SimpleTransform that sets negative and
zero values to zero and positive values to one.
|
TransformStatistics |
createStats()
Returns itself.
|
static SimpleTransform |
div(double operand)
Generate a SimpleTransform that
divides each value by the operand.
|
static SimpleTransform |
exp()
Generate a SimpleTransform that applies
Math.exp(double) . |
Transformer |
generateTransformer()
Returns itself.
|
TransformationProvenance |
getProvenance() |
static SimpleTransform |
log()
Generate a SimpleTransform that applies
Math.log(double) . |
static SimpleTransform |
mul(double operand)
Generate a SimpleTransform that
multiplies each value by the operand.
|
void |
observeSparse()
Deprecated.
|
void |
observeSparse(int count)
No-op on this TransformStatistics.
|
void |
observeValue(double value)
No-op on this TransformStatistics.
|
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
static SimpleTransform |
sub(double operand)
Generate a SimpleTransform that
subtracts the operand from each value.
|
static SimpleTransform |
threshold(double min,
double max)
Generate a SimpleTransform that sets values below min to
min, and values above max to max.
|
String |
toString() |
double |
transform(double input)
Apply the operation to the input.
|
public static final double EPSILON
public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
public TransformationProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<TransformationProvenance>
public void observeValue(double value)
observeValue
in interface TransformStatistics
value
- The value to observe@Deprecated public void observeSparse()
observeSparse
in interface TransformStatistics
public void observeSparse(int count)
observeSparse
in interface TransformStatistics
count
- The number of sparse values.public Transformer generateTransformer()
generateTransformer
in interface TransformStatistics
public TransformStatistics createStats()
createStats
in interface Transformation
public double transform(double input)
transform
in interface Transformer
input
- The input value to transform.public static SimpleTransform exp()
Math.exp(double)
.public static SimpleTransform log()
Math.log(double)
.public static SimpleTransform add(double operand)
operand
- The operand to add.public static SimpleTransform sub(double operand)
operand
- The operand to subtract.public static SimpleTransform mul(double operand)
operand
- The operand to multiply.public static SimpleTransform div(double operand)
operand
- The divisor.public static SimpleTransform binarise()
public static SimpleTransform threshold(double min, double max)
min
- The minimum value. To not threshold below, set to Double.NEGATIVE_INFINITY
.max
- The maximum value. To not threshold above, set to Double.POSITIVE_INFINITY
.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.