Class FeatureSource<T extends InputFromManager,S,U extends FeatureInput>

Object
AnchorBean<FeatureSource<T,S,U>>
FeatureSource<T,S,U>
Type Parameters:
T - input-type from which one or more rows of features are derived
S - row-source that is duplicated for each new thread (to prevent any concurrency issues)
U - feature-input type for features bean-field
Direct Known Subclasses:
SingleRowPerInput

public abstract class FeatureSource<T extends InputFromManager,S,U extends FeatureInput> extends AnchorBean<FeatureSource<T,S,U>>
Extracts features from some kind of inputs to produce one or more rows in a feature-table.
Author:
Owen Feehan
  • Constructor Details

    • FeatureSource

      public FeatureSource()
  • Method Details

    • createExporter

      public abstract FeatureExporter<S> createExporter(LabelHeaders metadataHeaders, List<NamedBean<FeatureListProvider<U>>> features, FeatureOutputNames outputNames, Optional<InputGrouper> grouper, FeatureExporterContext context) throws CreateException
      Creates the FeatureExporter to be used for calculating and exporting feature-results.
      Parameters:
      metadataHeaders - headers to use for additional "metadata" before feature-results.
      features - the features to calculate.
      outputNames - the names of various kind of outputs.
      grouper - when defined, assigns each input to a group.
      context - IO-context.
      Returns:
      a newly created FeatureExporter as matches this source of features.
      Throws:
      CreateException - if it cannot be created.
    • includeGroupInExperiment

      public abstract boolean includeGroupInExperiment(boolean groupGeneratorDefined)
      Determines if group columns should be added to the CSV exports and other group exports may occur in sub-directories.
      Parameters:
      groupGeneratorDefined - has a group-generator been defined for this experiment?
      Returns:
      true if a group-generator has been defined, false otherwise
    • headers

      public abstract LabelHeaders headers(boolean groupsEnabled)
      Generates label-headers for the non-feature-result columns in the CSV.
      Parameters:
      groupsEnabled - whether groups are enabled
      Returns:
      a LabelHeaders object for the non-feature-result columns
    • calculateAndOutput

      public abstract void calculateAndOutput(T input, FeatureCalculationContext<S> context) throws OperationFailedException
      Processes one input to calculate feature-results and output them to the file-system.
      Parameters:
      input - one particular input that will create one or more "rows" in a feature-table
      context - the FeatureCalculationContext for calculation
      Throws:
      OperationFailedException - if the operation fails
    • inputTypesExpected

      public abstract InputTypesExpected inputTypesExpected()
      Specifies the highest class(es) that will function as a valid input.

      This is usually the class of T (or sometimes the absolute base class InputFromManager)

      Returns:
      an InputTypesExpected object specifying the expected input types