Class SwapPLS

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractConversion>, SizeOfHandler, Stoppable, Conversion, InPlaceProcessing, Serializable

    public class SwapPLS
    extends AbstractSwapObject
    Swaps 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 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.
    • Constructor Detail

      • SwapPLS

        public SwapPLS()
    • Method Detail

      • 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.
      • 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 update
        numComponents - the number of components to set
        Returns:
        true if successfully updated
      • canSwap

        protected boolean canSwap​(PropertyPath.Path path,
                                  PropertyDescriptor desc,
                                  Object parent,
                                  Object child)
        Checks whether a swap can be made.
        Specified by:
        canSwap in class AbstractSwapObject
        Parameters:
        path - the current path
        desc - the property descriptor
        parent - the parent object to swap
        child - the child object to swap
        Returns:
        true if swap can be done