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.Filterm_Filterthe Weka filter.protected adams.flow.core.Actorm_FlowContextthe flow context.protected adams.data.instances.AbstractInstanceGeneratorm_Generatorthe instance generator to use.protected adams.flow.core.WekaFilterModelLoaderm_ModelLoaderthe loader for the Weka filter.protected Stringm_Prefixthe prefix for the report.protected adams.core.base.BaseRegExpm_RegExpthe 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 voiddefineOptions()Adds options to the internal list of options.StringgeneratorTipText()Returns the tip text for this property.adams.flow.core.ActorgetFlowContext()Returns the flow context.adams.data.instances.AbstractInstanceGeneratorgetGenerator()Returns the generator in use.adams.flow.core.CallableActorReferencegetModelActor()Returns the filter source actor.adams.core.io.PlaceholderFilegetModelFile()Returns the file to load the model from.adams.flow.core.AbstractModelLoader.ModelLoadingTypegetModelLoadingType()Returns the loading type.adams.flow.control.StorageNamegetModelStorage()Returns the filter storage item.StringgetPrefix()Returns the prefix for the report fields.adams.core.base.BaseRegExpgetRegExp()Returns the regular expression that the Instance attribute names must match in order to get transferred into the report.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.StringmodelActorTipText()Returns the tip text for this property.StringmodelFileTipText()Returns the tip text for this property.StringmodelLoadingTypeTipText()Returns the tip text for this property.StringmodelStorageTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.protected SpectrumprocessData(Spectrum data)Performs the actual filtering.StringregExpTipText()Returns the tip text for this property.voidreset()Resets the scheme.voidsetFlowContext(adams.flow.core.Actor value)Sets the flow context.voidsetGenerator(adams.data.instances.AbstractInstanceGenerator value)Sets the generator to use.voidsetLoggingLevel(adams.core.logging.LoggingLevel value)Sets the logging level.voidsetModelActor(adams.flow.core.CallableActorReference value)Sets the filter source actor.voidsetModelFile(adams.core.io.PlaceholderFile value)Sets the file to load the model from.voidsetModelLoadingType(adams.flow.core.AbstractModelLoader.ModelLoadingType value)Sets the loading type.voidsetModelStorage(adams.flow.control.StorageName value)Sets the filter storage item.voidsetPrefix(String value)Sets the prefix for the report fields.voidsetRegExp(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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.data.filter.AbstractFilter<Spectrum>
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein 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:
setFlowContextin interfaceadams.flow.core.FlowContextHandler- Parameters:
value- the context
-
getFlowContext
public adams.flow.core.Actor getFlowContext()
Returns the flow context.- Specified by:
getFlowContextin interfaceadams.flow.core.FlowContextHandler- Returns:
- the context
-
setLoggingLevel
public void setLoggingLevel(adams.core.logging.LoggingLevel value)
Sets the logging level.- Specified by:
setLoggingLevelin interfaceadams.core.logging.LoggingLevelHandler- Overrides:
setLoggingLevelin 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:
setModelLoadingTypein 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:
getModelLoadingTypein interfaceadams.flow.core.ModelLoaderSupporter- Returns:
- the type
-
modelLoadingTypeTipText
public String modelLoadingTypeTipText()
Returns the tip text for this property.- Specified by:
modelLoadingTypeTipTextin 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:
setModelFilein interfaceadams.core.io.ModelFileHandler- Specified by:
setModelFilein 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:
getModelFilein interfaceadams.core.io.ModelFileHandler- Specified by:
getModelFilein interfaceadams.flow.core.ModelLoaderSupporter- Returns:
- the model file
-
modelFileTipText
public String modelFileTipText()
Returns the tip text for this property.- Specified by:
modelFileTipTextin interfaceadams.core.io.ModelFileHandler- Specified by:
modelFileTipTextin 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:
setModelActorin interfaceadams.flow.core.ModelLoaderSupporter- Parameters:
value- the source
-
getModelActor
public adams.flow.core.CallableActorReference getModelActor()
Returns the filter source actor.- Specified by:
getModelActorin interfaceadams.flow.core.ModelLoaderSupporter- Returns:
- the source
-
modelActorTipText
public String modelActorTipText()
Returns the tip text for this property.- Specified by:
modelActorTipTextin 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:
setModelStoragein interfaceadams.flow.core.ModelLoaderSupporter- Parameters:
value- the storage item
-
getModelStorage
public adams.flow.control.StorageName getModelStorage()
Returns the filter storage item.- Specified by:
getModelStoragein interfaceadams.flow.core.ModelLoaderSupporter- Returns:
- the storage item
-
modelStorageTipText
public String modelStorageTipText()
Returns the tip text for this property.- Specified by:
modelStorageTipTextin 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.
-
-