Package adams.data.weka.predictions
Class AbstractErrorScaler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.weka.predictions.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
-
-
Constructor Summary
Constructors Constructor Description AbstractErrorScaler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
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 interfaceweka.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 classadams.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.
-
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 instantiateoptions
- 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
-
-