Package org.tribuo.transform
Class TransformationMap
java.lang.Object
org.tribuo.transform.TransformationMap
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
public class TransformationMap
extends Object
implements com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
A carrier type for a set of transformations to be applied to a
Dataset
.
Feature specific transformations are specified using a regex. If multiple
regexes match a given feature, then an IllegalArgumentException
is thrown
when Dataset.createTransformers(TransformationMap)
is called.
Global transformations are applied after all feature specific transformations.
Transformations only operate on observed values. To operate on implicit zeros then
first call MutableDataset.densify()
on the datasets.
See org.tribuo.transform
for a more detailed discussion of densify.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A carrier type as OLCUT does not support nested generics. -
Constructor Summary
ConstructorDescriptionTransformationMap
(List<Transformation> globalTransformations) Creates a TransformationMap with only global transformations.TransformationMap
(List<Transformation> globalTransformations, Map<String, List<Transformation>> featureTransformations) Creates a transformation map from the supplied global transformation list, and per feature transformations.TransformationMap
(Map<String, List<Transformation>> featureTransformations) Creates a TransformationMap with only per feature transformations. -
Method Summary
Modifier and TypeMethodDescriptionGets the map of feature specific transformations.Gets the global transformations in this TransformationMap.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
void
Used by the OLCUT configuration system, and should not be called by external code.toString()
boolean
validateTransformations
(FeatureMap featureMap) Checks that a given transformation set doesn't have conflicts when applied to the supplied featureMap.
-
Constructor Details
-
TransformationMap
public TransformationMap(List<Transformation> globalTransformations, Map<String, List<Transformation>> featureTransformations) Creates a transformation map from the supplied global transformation list, and per feature transformations.- Parameters:
globalTransformations
- The global transformations.featureTransformations
- The per feature transformations.
-
TransformationMap
Creates a TransformationMap with only global transformations.- Parameters:
globalTransformations
- The global transformations.
-
TransformationMap
Creates a TransformationMap with only per feature transformations.- Parameters:
featureTransformations
- The per feature transformations.
-
-
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
-
validateTransformations
Checks that a given transformation set doesn't have conflicts when applied to the supplied featureMap.- Parameters:
featureMap
- The featureMap to check.- Returns:
- True if the transformation set doesn't have conflicts, false otherwise.
-
toString
-
getGlobalTransformations
Gets the global transformations in this TransformationMap.- Returns:
- The global transformations
-
getFeatureTransformations
Gets the map of feature specific transformations.- Returns:
- The feature specific transformations.
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-