public final class TransformerMap extends Object implements com.oracle.labs.mlrg.olcut.provenance.Provenancable<TransformerMap.TransformerMapProvenance>, Serializable
Transformer
s which can be applied to a Dataset
or Example
. A TransformerMap is created by applying a TransformationMap
to a Dataset. It contains Transformers which are specific to the Dataset which created
it, for example the range of a feature used in binning is fixed to the value from
that Dataset.
Transformations only operate on observed values. To operate on implicit zeros then
first call MutableDataset.densify()
on the datasets.
Modifier and Type | Class and Description |
---|---|
static class |
TransformerMap.TransformerMapProvenance
Provenance for
TransformerMap . |
Constructor and Description |
---|
TransformerMap(Map<String,List<Transformer>> map,
DatasetProvenance datasetProvenance,
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance transformationMapProvenance)
Constructs a transformer map which encapsulates a set of transformers that can be applied to features.
|
Modifier and Type | Method and Description |
---|---|
static double |
applyTransformerList(double value,
List<Transformer> transformerList)
Applies a
List of Transformer s to the supplied double value,
returning the transformed value. |
Set<Map.Entry<String,List<Transformer>>> |
entrySet()
Get the feature names and associated list of transformers.
|
TransformerMap.TransformerMapProvenance |
getProvenance() |
String |
toString() |
<T extends Output<T>> |
transformDataset(Dataset<T> dataset)
Copies the supplied dataset and applies the transformers to each example in it.
|
<T extends Output<T>> |
transformDataset(Dataset<T> dataset,
boolean densify)
Copies the supplied dataset and applies the transformers to each example in it.
|
<T extends Output<T>> |
transformExample(Example<T> example)
Copies the supplied example and applies the transformers to it.
|
<T extends Output<T>> |
transformExample(Example<T> example,
List<String> featureNames)
Copies the supplied example and applies the transformers to it.
|
public TransformerMap(Map<String,List<Transformer>> map, DatasetProvenance datasetProvenance, com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance transformationMapProvenance)
map
- The transformers, one per transformed feature.datasetProvenance
- The provenance of the dataset the transformers were fit against.transformationMapProvenance
- The provenance of the transformation map that was fit.public static double applyTransformerList(double value, List<Transformer> transformerList)
List
of Transformer
s to the supplied double value,
returning the transformed value.value
- The value to transform.transformerList
- The transformers to apply.public <T extends Output<T>> Example<T> transformExample(Example<T> example)
T
- The type of Output.example
- The example to transform.public <T extends Output<T>> Example<T> transformExample(Example<T> example, List<String> featureNames)
T
- The type of Output.example
- The example to transform.featureNames
- The feature names to densify.public <T extends Output<T>> MutableDataset<T> transformDataset(Dataset<T> dataset)
Does not densify the dataset first.
T
- The type of Output.dataset
- The dataset to transform.public <T extends Output<T>> MutableDataset<T> transformDataset(Dataset<T> dataset, boolean densify)
T
- The type of Output.dataset
- The dataset to transform.densify
- Densify the dataset before transforming it.public Set<Map.Entry<String,List<Transformer>>> entrySet()
public TransformerMap.TransformerMapProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<TransformerMap.TransformerMapProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.