Class TransformationMap

All Implemented Interfaces:,<>

public class TransformationMap extends Object implements,<>
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.

  • 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.
      globalTransformations - The global transformations.
      featureTransformations - The per feature transformations.
    • TransformationMap

      public TransformationMap(List<Transformation> globalTransformations)
      Creates a TransformationMap with only global transformations.
      globalTransformations - The global transformations.
    • TransformationMap

      public TransformationMap(Map<String,List<Transformation>> featureTransformations)
      Creates a TransformationMap with only per feature transformations.
      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 interface
    • validateTransformations

      public boolean validateTransformations(FeatureMap featureMap)
      Checks that a given transformation set doesn't have conflicts when applied to the supplied featureMap.
      featureMap - The featureMap to check.
      True if the transformation set doesn't have conflicts, false otherwise.
    • toString

      public String toString()
      toString in class Object
    • getGlobalTransformations

      public List<Transformation> getGlobalTransformations()
      Gets the global transformations in this TransformationMap.
      The global transformations
    • getFeatureTransformations

      public Map<String,List<Transformation>> getFeatureTransformations()
      Gets the map of feature specific transformations.
      The feature specific transformations.
    • getProvenance

      public getProvenance()
      Specified by:
      getProvenance in interface<>