Package adams.data.conversion
Class SwapPLS
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.conversion.AbstractConversion
-
- adams.data.conversion.AbstractSwapObject
-
- adams.data.conversion.SwapPLS
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler,adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.ShallowCopySupporter<adams.data.conversion.AbstractConversion>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.data.conversion.Conversion,adams.data.InPlaceProcessing,Serializable
public class SwapPLS extends adams.data.conversion.AbstractSwapObjectSwaps one PLS filter for another.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-no-copy <boolean> (property: noCopy) If enabled, no copy of the object is created before swapping. default: false
-old-filter <weka.filters.Filter> (property: oldFilter) The old PLS filter to replace. default: weka.filters.supervised.attribute.PLSFilter -C 20 -M -A PLS1 -P center
-exact-match <boolean> (property: exactMatch) If enabled, then the complete command-line is used for comparison rather than just the class name. default: false
-new-filter <weka.filters.Filter> (property: newFilter) The new PLS filter to replace with. default: weka.filters.supervised.attribute.PLS -algorithm adams.data.instancesanalysis.pls.PLS1
-keep-num-components <boolean> (property: keepNumComponents) If enabled, then the 'number of components' of the old filter are retained. default: true
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_ExactMatchwhether to use an exact match (incl options) or just the class name.protected booleanm_KeepNumComponentswhether to migrate the number of components.protected weka.filters.Filterm_NewFilterthe new PLS filter.protected weka.filters.Filterm_OldFilterthe old PLS filter.protected Stringm_OldFilterCommandLinethe command-line of the old filter.
-
Constructor Summary
Constructors Constructor Description SwapPLS()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanSwap(adams.core.discovery.PropertyPath.Path path, PropertyDescriptor desc, Object parent, Object child)Checks whether a swap can be made.voiddefineOptions()Adds options to the internal list of options.StringexactMatchTipText()Returns the tip text for this property.booleangetExactMatch()Returns whether to use the complete command-line for comparison rather than just the class name.booleangetKeepNumComponents()Returns whether the 'number of components' of the old filter are retained.weka.filters.FiltergetNewFilter()Returns the new PLS filter to replace with.protected intgetNumComponents(Object filter)Retrieves the number of components from the filter.weka.filters.FiltergetOldFilter()Returns the old PLS filter to replace.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringglobalInfo()Returns a string describing the object.protected booleanisPLSFilter(weka.filters.Filter filter)Checks whether the filter is an actual PLS filter.StringkeepNumComponentsTipText()Returns the tip text for this property.StringnewFilterTipText()Returns the tip text for this property.StringoldFilterTipText()Returns the tip text for this property.protected booleanperformSwap(adams.core.discovery.PropertyPath.Path path, PropertyDescriptor desc, Object parent, Object child)Performs the swap.protected voidreset()Resets the scheme.voidsetExactMatch(boolean value)Sets whether to use the complete command-line for comparison rather than just the class name.voidsetKeepNumComponents(boolean value)Sets whether the 'number of components' of the old filter are retained.voidsetNewFilter(weka.filters.Filter value)Sets the new PLS filter to replace with.protected booleansetNumComponents(Object filter, int numComponents)Sets the number of components in the filter.voidsetOldFilter(weka.filters.Filter value)Sets the old PLS filter to replace.-
Methods inherited from class adams.data.conversion.AbstractSwapObject
accepts, doConvert, doConvert, generates, getNoCopy, noCopyTipText, setNoCopy
-
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_OldFilter
protected weka.filters.Filter m_OldFilter
the old PLS filter.
-
m_ExactMatch
protected boolean m_ExactMatch
whether to use an exact match (incl options) or just the class name.
-
m_NewFilter
protected weka.filters.Filter m_NewFilter
the new PLS filter.
-
m_KeepNumComponents
protected boolean m_KeepNumComponents
whether to migrate the number of components.
-
m_OldFilterCommandLine
protected transient String m_OldFilterCommandLine
the command-line of the old filter.
-
-
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.conversion.AbstractSwapObject
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classadams.data.conversion.AbstractConversion
-
setOldFilter
public void setOldFilter(weka.filters.Filter value)
Sets the old PLS filter to replace.- Parameters:
value- the old filter
-
getOldFilter
public weka.filters.Filter getOldFilter()
Returns the old PLS filter to replace.- Returns:
- the old filter
-
oldFilterTipText
public String oldFilterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setExactMatch
public void setExactMatch(boolean value)
Sets whether to use the complete command-line for comparison rather than just the class name.- Parameters:
value- true if to use exact match
-
getExactMatch
public boolean getExactMatch()
Returns whether to use the complete command-line for comparison rather than just the class name.- Returns:
- true if to use exact match
-
exactMatchTipText
public String exactMatchTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNewFilter
public void setNewFilter(weka.filters.Filter value)
Sets the new PLS filter to replace with.- Parameters:
value- the new filter
-
getNewFilter
public weka.filters.Filter getNewFilter()
Returns the new PLS filter to replace with.- Returns:
- the new filter
-
newFilterTipText
public String newFilterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setKeepNumComponents
public void setKeepNumComponents(boolean value)
Sets whether the 'number of components' of the old filter are retained.- Parameters:
value- true if to keep
-
getKeepNumComponents
public boolean getKeepNumComponents()
Returns whether the 'number of components' of the old filter are retained.- Returns:
- true if to keep
-
keepNumComponentsTipText
public String keepNumComponentsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classadams.data.conversion.AbstractConversion- Returns:
- null if no info available, otherwise short string
-
isPLSFilter
protected boolean isPLSFilter(weka.filters.Filter filter)
Checks whether the filter is an actual PLS filter.- Parameters:
filter- the filter to check- Returns:
- true if PLS filter
-
getNumComponents
protected int getNumComponents(Object filter)
Retrieves the number of components from the filter.- Parameters:
filter- the filter to get the number of components from- Returns:
- the number of components, -1 if failed to retrieve
-
setNumComponents
protected boolean setNumComponents(Object filter, int numComponents)
Sets the number of components in the filter.- Parameters:
filter- the filter to updatenumComponents- the number of components to set- Returns:
- true if successfully updated
-
canSwap
protected boolean canSwap(adams.core.discovery.PropertyPath.Path path, PropertyDescriptor desc, Object parent, Object child)Checks whether a swap can be made.- Specified by:
canSwapin classadams.data.conversion.AbstractSwapObject- Parameters:
path- the current pathdesc- the property descriptorparent- the parent object to swapchild- the child object to swap- Returns:
- true if swap can be done
-
performSwap
protected boolean performSwap(adams.core.discovery.PropertyPath.Path path, PropertyDescriptor desc, Object parent, Object child)Performs the swap.- Specified by:
performSwapin classadams.data.conversion.AbstractSwapObject- Parameters:
path- the current pathdesc- the property descriptorparent- the parent object to swapchild- the child object to swap- Returns:
- true if swap was successful
-
-