Class WekaFilter

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

    public class WekaFilter
    extends AbstractTransformerWithPropertiesUpdating
    implements OptionalContainerOutput, ModelFileHandler, StorageUser, ModelLoaderSupporter, OptionalOneTimeInitializer, JobRunnerSupporter
    Filters Instances/Instance objects using the specified filter.
    When re-using a trained filter, ensure that 'initializeOnce' is checked.

    The following order is used to obtain the model (when using AUTO):
    1. model file present?
    2. source actor present?
    3. storage item present?
    4. use specified filter definition

    Input/output:
    - accepts:
       weka.core.Instance
       weka.core.Instances
       adams.data.instance.Instance
    - generates:
       weka.core.Instance
       weka.core.Instances
       adams.data.instance.Instance


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
        min-user-mode: Expert
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: WekaFilter
     
    -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 execution at this level gets stopped in case this
        actor encounters an error; the error gets propagated; useful for critical
        actors.
        default: false
        min-user-mode: Expert
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing
        actor handler must have this enabled as well.
        default: false
        min-user-mode: Expert
     
    -property <adams.core.base.BaseString> [-property ...] (property: properties)
        The properties to update with the values associated with the specified values.
        default:
     
    -variable <adams.core.VariableName> [-variable ...] (property: variableNames)
        The names of the variables to update the properties with.
        default:
     
    -filter <weka.filters.Filter> (property: filter)
        The filter to use for filtering the Instances/Instance objects.
        default: weka.filters.AllFilter
     
    -model-loading-type <AUTO|FILE|SOURCE_ACTOR|STORAGE> (property: modelLoadingType)
        Determines how to load the model, in case of AUTO, first the model file
        is checked, then the callable actor and then the storage.
        default: AUTO
     
    -model <adams.core.io.PlaceholderFile> (property: modelFile)
        The file to load the model from, ignored if pointing to a directory.
        default: ${CWD}
     
    -source <adams.flow.core.CallableActorReference> (property: modelActor)
        The callable actor (source) to obtain the model from, ignored if not present.
        default:
     
    -storage <adams.flow.control.StorageName> (property: modelStorage)
        The storage item to obtain the model from, ignored if not present.
        default: storage
     
    -init-once <boolean> (property: initializeOnce)
        If set to true, then the filter will get initialized only with the first
        batch of data; otherwise every time data gets passed through; only applies
        when using the filter definition, the others (model file, source, storage
        ) assume the filter to be built.
        default: false
     
    -keep <boolean> (property: keepRelationName)
        If set to true, then the filter won't change the relation name of the incoming
        dataset.
        default: false
     
    -prefer-jobrunner <boolean> (property: preferJobRunner)
        If enabled, tries to offload the processing onto a adams.flow.standalone.JobRunnerInstance;
         applies only to batch filtering.
        default: false
     
    -output-container <boolean> (property: outputContainer)
        If enabled, a adams.flow.container.WekaFilterContainer is output with the
        filter and the filtered data (Instance or Instances).
        default: false
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • BACKUP_INITIALIZED

        public static final String BACKUP_INITIALIZED
        the key for storing the current initialized state in the backup.
        See Also:
        Constant Field Values
      • m_Filter

        protected weka.filters.Filter m_Filter
        the filter to apply.
      • m_ActualFilter

        protected weka.filters.Filter m_ActualFilter
        the actual filter used.
      • m_InitializeOnce

        protected boolean m_InitializeOnce
        whether to initialize filter only with the first batch.
      • m_KeepRelationName

        protected boolean m_KeepRelationName
        whether to keep the incoming relation name.
      • m_OutputContainer

        protected boolean m_OutputContainer
        whether to output a container.
      • m_Initialized

        protected boolean m_Initialized
        whether the filter has been initialized.
      • m_FlowContextUpdated

        protected boolean m_FlowContextUpdated
        whether the flow context has been updated.
      • m_PreferJobRunner

        protected boolean m_PreferJobRunner
        whether to offload filtering into a JobRunnerInstance.
      • m_JobRunnerInstance

        protected transient JobRunnerInstance m_JobRunnerInstance
        the JobRunnerInstance to use.
    • Constructor Detail

      • WekaFilter

        public WekaFilter()