Class AbstractErrorScaler

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable, weka.core.CapabilitiesHandler
    Direct Known Subclasses:
    AutoScaler, FixedSizeErrorScaler, NumericErrorScalerWithReference, RelativeNumericErrorScaler, RoundErrorScaler

    public abstract class AbstractErrorScaler
    extends adams.core.option.AbstractOptionHandler
    implements weka.core.CapabilitiesHandler
    Ancestor for classes that scale predictions.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Detail

      • AbstractErrorScaler

        public AbstractErrorScaler()
    • Method Detail

      • getCapabilities

        public abstract weka.core.Capabilities getCapabilities()
        Returns the capabilities of this object. Returns what types of classes the scaler can handle.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Returns:
        the capabilities of this object
        See Also:
        Capabilities
      • scale

        public abstract ArrayList<Integer> scale​(ArrayList data)
        Scales the errors.
        Parameters:
        data - the data containing the errors to scale
        Returns:
        the scaled errors
      • toString

        public String toString()
        Returns the commandline of this object.
        Overrides:
        toString in class adams.core.option.AbstractOptionHandler
        Returns:
        the commandline
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only compares the commandlines of the two objects.
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the commandlines of the two objects.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared
        Returns:
        true if the object is the same as this one
      • shallowCopy

        public AbstractErrorScaler shallowCopy()
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Returns:
        the shallow copy
      • shallowCopy

        public AbstractErrorScaler shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Parameters:
        expand - whether to expand variables to their current values
        Returns:
        the shallow copy
      • getErrorScalers

        public static String[] getErrorScalers()
        Returns a list with classnames of scalers.
        Returns:
        the scaler classnames
      • forName

        public static AbstractErrorScaler forName​(String classname,
                                                  String[] options)
        Instantiates the scaler with the given options.
        Parameters:
        classname - the classname of the scaler to instantiate
        options - the options for the scaler
        Returns:
        the instantiated scaler or null if an error occurred
      • forCommandLine

        public static AbstractErrorScaler forCommandLine​(String cmdline)
        Instantiates the scaler from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the scaler to instantiate
        Returns:
        the instantiated scaler or null if an error occurred