Class TabularTranslator

java.lang.Object
ai.djl.basicdataset.tabular.TabularTranslator
All Implemented Interfaces:
ai.djl.translate.PostProcessor<TabularResults>, ai.djl.translate.PreProcessor<ListFeatures>, ai.djl.translate.Translator<ListFeatures,TabularResults>

public class TabularTranslator extends Object implements ai.djl.translate.Translator<ListFeatures,TabularResults>
A Translator that can be used for Application.Tabular tasks.
  • Constructor Details

    • TabularTranslator

      public TabularTranslator(List<Feature> features, List<Feature> labels)
      Constructs a TabularTranslator with the given features and labels.
      Parameters:
      features - the features for inputs
      labels - the labels for outputs
    • TabularTranslator

      public TabularTranslator(ai.djl.Model model, Map<String,?> arguments)
      Constructs a tabular translator for a model.
      Parameters:
      model - the model
      arguments - the arguments to build the translator with
  • Method Details

    • processOutput

      public TabularResults processOutput(ai.djl.translate.TranslatorContext ctx, ai.djl.ndarray.NDList list) throws Exception
      Specified by:
      processOutput in interface ai.djl.translate.PostProcessor<TabularResults>
      Throws:
      Exception
    • processInput

      public ai.djl.ndarray.NDList processInput(ai.djl.translate.TranslatorContext ctx, ListFeatures input) throws Exception
      Specified by:
      processInput in interface ai.djl.translate.PreProcessor<ListFeatures>
      Throws:
      Exception
    • getExpansions

      public ai.djl.translate.TranslatorOptions getExpansions()
      Specified by:
      getExpansions in interface ai.djl.translate.Translator<ListFeatures,TabularResults>
    • getFeatures

      public List<Feature> getFeatures()
      Returns the features for the translator.
      Returns:
      the features for the translator
    • getLabels

      public List<Feature> getLabels()
      Returns the labels for the translator.
      Returns:
      the labels for the translator