adams.data.weka.predictions
Class AbstractErrorScaler

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.weka.predictions.AbstractErrorScaler
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable, weka.core.CapabilitiesHandler
Direct Known Subclasses:
AutoScaler, FixedSizeErrorScaler, NamedSetup, RelativeNumericErrorScaler, RoundErrorScaler

public abstract class AbstractErrorScaler
extends AbstractOptionHandler
implements weka.core.CapabilitiesHandler

Ancestor for classes that scale predictions.

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractErrorScaler()
           
 
Method Summary
 int compareTo(Object o)
          Compares this object with the specified object for order.
 boolean equals(Object o)
          Returns whether the two objects are the same.
static AbstractErrorScaler forCommandLine(String cmdline)
          Instantiates the scaler from the given commandline (i.e., classname and optional options).
static AbstractErrorScaler forName(String classname, String[] options)
          Instantiates the scaler with the given options.
abstract  weka.core.Capabilities getCapabilities()
          Returns the capabilities of this object.
static String[] getErrorScalers()
          Returns a list with classnames of scalers.
abstract  ArrayList<Integer> scale(ArrayList data)
          Scales the errors.
 AbstractErrorScaler shallowCopy()
          Returns a shallow copy of itself, i.e., based on the commandline options.
 AbstractErrorScaler shallowCopy(boolean expand)
          Returns a shallow copy of itself, i.e., based on the commandline options.
 String toString()
          Returns the commandline of this object.
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, defineOptions, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 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


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.