Package adams.data.spectrumfilter
Class WekaFilterToReport
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<Spectrum>
-
- adams.data.spectrumfilter.WekaFilterToReport
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.io.ModelFileHandler
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.ShallowCopySupporter<adams.data.filter.Filter>
,adams.core.SizeOfHandler
,adams.data.filter.Filter<Spectrum>
,adams.flow.core.FlowContextHandler
,adams.flow.core.ModelLoaderSupporter
,Serializable
,Comparable
public class WekaFilterToReport extends adams.data.filter.AbstractFilter<Spectrum> implements adams.flow.core.FlowContextHandler, adams.flow.core.ModelLoaderSupporter
Generates a Weka Instance using the specified instance generator. The Instance gets pushed through the prebuilt Weka filter that was loaded. The values of the matching attributes from the filtered data get transferred to the spectrum's report.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-no-id-update <boolean> (property: dontUpdateID) If enabled, suppresses updating the ID of adams.data.id.IDHandler data containers. default: false
-generator <adams.data.instances.AbstractInstanceGenerator> (property: generator) The generator to use for turning spectra into weka.core.Instance objects. default: adams.data.instances.SimpleInstanceGenerator
-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}
-model-actor <adams.flow.core.CallableActorReference> (property: modelActor) The callable actor (source) to obtain the model from, ignored if not present. default:
-model-storage <adams.flow.control.StorageName> (property: modelStorage) The storage item to obtain the model from, ignored if not present. default: storage
-prefix <java.lang.String> (property: prefix) The prefix to use for the report fields. default:
-regexp <adams.core.base.BaseRegExp> (property: regExp) The regular expression that the Instance attribute names must match in order to get transferred into the report. default: .*
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.filters.Filter
m_Filter
the Weka filter.protected adams.flow.core.Actor
m_FlowContext
the flow context.protected adams.data.instances.AbstractInstanceGenerator
m_Generator
the instance generator to use.protected adams.flow.core.WekaFilterModelLoader
m_ModelLoader
the loader for the Weka filter.protected String
m_Prefix
the prefix for the report.protected adams.core.base.BaseRegExp
m_RegExp
the regular expression for the attribute names to transfer.
-
Constructor Summary
Constructors Constructor Description WekaFilterToReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
generatorTipText()
Returns the tip text for this property.adams.flow.core.Actor
getFlowContext()
Returns the flow context.adams.data.instances.AbstractInstanceGenerator
getGenerator()
Returns the generator in use.adams.flow.core.CallableActorReference
getModelActor()
Returns the filter source actor.adams.core.io.PlaceholderFile
getModelFile()
Returns the file to load the model from.adams.flow.core.AbstractModelLoader.ModelLoadingType
getModelLoadingType()
Returns the loading type.adams.flow.control.StorageName
getModelStorage()
Returns the filter storage item.String
getPrefix()
Returns the prefix for the report fields.adams.core.base.BaseRegExp
getRegExp()
Returns the regular expression that the Instance attribute names must match in order to get transferred into the report.String
globalInfo()
Returns a string describing the object.protected void
initialize()
Initializes the members.String
modelActorTipText()
Returns the tip text for this property.String
modelFileTipText()
Returns the tip text for this property.String
modelLoadingTypeTipText()
Returns the tip text for this property.String
modelStorageTipText()
Returns the tip text for this property.String
prefixTipText()
Returns the tip text for this property.protected Spectrum
processData(Spectrum data)
Performs the actual filtering.String
regExpTipText()
Returns the tip text for this property.void
reset()
Resets the scheme.void
setFlowContext(adams.flow.core.Actor value)
Sets the flow context.void
setGenerator(adams.data.instances.AbstractInstanceGenerator value)
Sets the generator to use.void
setLoggingLevel(adams.core.logging.LoggingLevel value)
Sets the logging level.void
setModelActor(adams.flow.core.CallableActorReference value)
Sets the filter source actor.void
setModelFile(adams.core.io.PlaceholderFile value)
Sets the file to load the model from.void
setModelLoadingType(adams.flow.core.AbstractModelLoader.ModelLoadingType value)
Sets the loading type.void
setModelStorage(adams.flow.control.StorageName value)
Sets the filter storage item.void
setPrefix(String value)
Sets the prefix for the report fields.void
setRegExp(adams.core.base.BaseRegExp value)
Sets the regular expression that the Instance attribute names must match in order to get transferred into the report.-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, setDontUpdateID, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Generator
protected adams.data.instances.AbstractInstanceGenerator m_Generator
the instance generator to use.
-
m_ModelLoader
protected adams.flow.core.WekaFilterModelLoader m_ModelLoader
the loader for the Weka filter.
-
m_Filter
protected weka.filters.Filter m_Filter
the Weka filter.
-
m_Prefix
protected String m_Prefix
the prefix for the report.
-
m_RegExp
protected adams.core.base.BaseRegExp m_RegExp
the regular expression for the attribute names to transfer.
-
m_FlowContext
protected adams.flow.core.Actor m_FlowContext
the flow context.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.data.filter.AbstractFilter<Spectrum>
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classadams.core.option.AbstractOptionHandler
-
reset
public void reset()
Resets the scheme.
-
setFlowContext
public void setFlowContext(adams.flow.core.Actor value)
Sets the flow context.- Specified by:
setFlowContext
in interfaceadams.flow.core.FlowContextHandler
- Parameters:
value
- the context
-
getFlowContext
public adams.flow.core.Actor getFlowContext()
Returns the flow context.- Specified by:
getFlowContext
in interfaceadams.flow.core.FlowContextHandler
- Returns:
- the context
-
setLoggingLevel
public void setLoggingLevel(adams.core.logging.LoggingLevel value)
Sets the logging level.- Specified by:
setLoggingLevel
in interfaceadams.core.logging.LoggingLevelHandler
- Overrides:
setLoggingLevel
in classadams.core.option.AbstractOptionHandler
- Parameters:
value
- the level
-
setGenerator
public void setGenerator(adams.data.instances.AbstractInstanceGenerator value)
Sets the generator to use.- Parameters:
value
- the generator
-
getGenerator
public adams.data.instances.AbstractInstanceGenerator getGenerator()
Returns the generator in use.- Returns:
- the generator
-
generatorTipText
public String generatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setModelLoadingType
public void setModelLoadingType(adams.flow.core.AbstractModelLoader.ModelLoadingType value)
Sets the loading type. In case ofAbstractModelLoader.ModelLoadingType.AUTO
, first file, then callable actor, then storage.- Specified by:
setModelLoadingType
in interfaceadams.flow.core.ModelLoaderSupporter
- Parameters:
value
- the type
-
getModelLoadingType
public adams.flow.core.AbstractModelLoader.ModelLoadingType getModelLoadingType()
Returns the loading type. In case ofAbstractModelLoader.ModelLoadingType.AUTO
, first file, then callable actor, then storage.- Specified by:
getModelLoadingType
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- the type
-
modelLoadingTypeTipText
public String modelLoadingTypeTipText()
Returns the tip text for this property.- Specified by:
modelLoadingTypeTipText
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setModelFile
public void setModelFile(adams.core.io.PlaceholderFile value)
Sets the file to load the model from.- Specified by:
setModelFile
in interfaceadams.core.io.ModelFileHandler
- Specified by:
setModelFile
in interfaceadams.flow.core.ModelLoaderSupporter
- Parameters:
value
- the model file
-
getModelFile
public adams.core.io.PlaceholderFile getModelFile()
Returns the file to load the model from.- Specified by:
getModelFile
in interfaceadams.core.io.ModelFileHandler
- Specified by:
getModelFile
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- the model file
-
modelFileTipText
public String modelFileTipText()
Returns the tip text for this property.- Specified by:
modelFileTipText
in interfaceadams.core.io.ModelFileHandler
- Specified by:
modelFileTipText
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setModelActor
public void setModelActor(adams.flow.core.CallableActorReference value)
Sets the filter source actor.- Specified by:
setModelActor
in interfaceadams.flow.core.ModelLoaderSupporter
- Parameters:
value
- the source
-
getModelActor
public adams.flow.core.CallableActorReference getModelActor()
Returns the filter source actor.- Specified by:
getModelActor
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- the source
-
modelActorTipText
public String modelActorTipText()
Returns the tip text for this property.- Specified by:
modelActorTipText
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setModelStorage
public void setModelStorage(adams.flow.control.StorageName value)
Sets the filter storage item.- Specified by:
setModelStorage
in interfaceadams.flow.core.ModelLoaderSupporter
- Parameters:
value
- the storage item
-
getModelStorage
public adams.flow.control.StorageName getModelStorage()
Returns the filter storage item.- Specified by:
getModelStorage
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- the storage item
-
modelStorageTipText
public String modelStorageTipText()
Returns the tip text for this property.- Specified by:
modelStorageTipText
in interfaceadams.flow.core.ModelLoaderSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPrefix
public void setPrefix(String value)
Sets the prefix for the report fields.- Parameters:
value
- the prefix
-
getPrefix
public String getPrefix()
Returns the prefix for the report fields.- Returns:
- the prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRegExp
public void setRegExp(adams.core.base.BaseRegExp value)
Sets the regular expression that the Instance attribute names must match in order to get transferred into the report.- Parameters:
value
- the expression
-
getRegExp
public adams.core.base.BaseRegExp getRegExp()
Returns the regular expression that the Instance attribute names must match in order to get transferred into the report.- Returns:
- the expression
-
regExpTipText
public String regExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
-