Class ConvertFeatures

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class ConvertFeatures
    extends AbstractTransformer
    Turns the raw features generated by a feature converter (stored in a adams.flow.container.FeatureConverterContainer) into a specific format using the user-defined feature converter.
    If an array of containers is received, the get merged first, i.e., placed side-by-side.

    Input/output:
    - accepts:
       adams.flow.container.FeatureConverterContainer
       adams.flow.container.FeatureConverterContainer[]
    - generates:
       java.lang.String


    Container information:
    - adams.flow.container.FeatureConverterContainer: Header, Row

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: ConvertFeatures
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console.
        default: false
     
    -converter <adams.data.featureconverter.AbstractFeatureConverter> (property: converter)
        The converter to use for turning the raw features into a specific format.
        default: adams.data.featureconverter.Text
     
    -merge-format <java.lang.String> (property: mergeFormat)
        The format to use for merging multiple feature containers before converting 
        them; use '@' for the dataset name, '#' for the 1-based array index and '
        $' for the feature name.
        default: @-$
     
    -output-type <HEADER|ROW|BOTH> (property: outputType)
        What data to generate; in case of BOTH an array with HEADER and ROW is output.
        default: HEADER
     
    Version:
    $Revision: 7330 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_MergeFormat

        protected String m_MergeFormat
        the format to use for merging multiple feature sets.
    • Constructor Detail

      • ConvertFeatures

        public ConvertFeatures()
    • Method Detail

      • setConverter

        public void setConverter​(AbstractFeatureConverter value)
        Sets the feature converter to use.
        Parameters:
        value - the converter
      • getConverter

        public AbstractFeatureConverter getConverter()
        Returns the feature converter in use.
        Returns:
        the converter
      • converterTipText

        public String converterTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMergeFormat

        public void setMergeFormat​(String value)
        Sets the format to use for merging multiple feature containers.
        Parameters:
        value - the format
      • getMergeFormat

        public String getMergeFormat()
        Returns the format in use for merging multiple feature containers.
        Returns:
        the format
      • mergeFormatTipText

        public String mergeFormatTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOutputType

        public void setOutputType​(ConvertFeatures.OutputType value)
        Sets the type of output to generate.
        Parameters:
        value - the output type
      • getOutputType

        public ConvertFeatures.OutputType getOutputType()
        Returns the type of output to generate.
        Returns:
        the output type
      • outputTypeTipText

        public String outputTypeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        adams.flow.container.FeatureConverterContainer.class, adams.flow.container.FeatureConverterContainer[].class
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Returns:
        java.lang.String.class
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message