Class AbstractGeneralSummaryStatistic
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.summarystatistics.AbstractSummaryStatistic
-
- adams.flow.transformer.summarystatistics.AbstractGeneralSummaryStatistic
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,CategoricalSummaryStatistic
,NumericSummaryStatistic
,SummaryStatistic
,Serializable
- Direct Known Subclasses:
NoPrediction
public abstract class AbstractGeneralSummaryStatistic extends AbstractSummaryStatistic implements NumericSummaryStatistic, CategoricalSummaryStatistic
Ancestor for statistics that can be applied to numeric and categorical predictions.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]
m_CategoricalActual
the actual values.protected String[]
m_CategoricalClassDistributionLabels
the class distribution labels (required if distributions provided).protected double[][]
m_CategoricalClassDistributions
the class distributions (optional).protected String[]
m_CategoricalPredicted
the predicted values.protected double[]
m_CategoricalProbabilities
the probabilities (optional).protected double[]
m_NumericActual
the actual values.protected double[]
m_NumericPredicted
the predicted values.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.transformer.summarystatistics.CategoricalSummaryStatistic
MISSING_CATEGORICAL
-
Fields inherited from interface adams.flow.transformer.summarystatistics.NumericSummaryStatistic
MISSING_NUMERIC
-
-
Constructor Summary
Constructors Constructor Description AbstractGeneralSummaryStatistic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
check()
Hook method for performing checks before calculating statistic.void
clear()
Clears all input.String[]
getCategoricalActual()
Returns the actual values.String[]
getCategoricalClassDistributionLabels()
Returns the class distributions values.double[][]
getCategoricalClassDistributions()
Returns the class distributions values.String[]
getCategoricalPredicted()
Returns the predicted values.double[]
getCategoricalProbabilities()
Returns the probabilities.double[]
getNumericActual()
Returns the actual values.double[]
getNumericPredicted()
Returns the predicted values.boolean
isNumeric()
Checks whether numeric predictions are available.void
setCategoricalActual(String[] value)
Sets the actual values.void
setCategoricalClassDistributionLabels(String[] value)
Sets the class labels (order in the class distributions).void
setCategoricalClassDistributions(double[][] value)
Sets the class distributions.void
setCategoricalPredicted(String[] value)
Sets the predicted values.void
setCategoricalProbabilities(double[] value)
Sets the probabilities.void
setNumericActual(double[] value)
Sets the actual values.void
setNumericPredicted(double[] value)
Sets the predicted values.-
Methods inherited from class adams.flow.transformer.summarystatistics.AbstractSummaryStatistic
calculate, doCalculate
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.flow.transformer.summarystatistics.SummaryStatistic
calculate, getNames
-
-
-
-
Field Detail
-
m_NumericActual
protected double[] m_NumericActual
the actual values.
-
m_NumericPredicted
protected double[] m_NumericPredicted
the predicted values.
-
m_CategoricalActual
protected String[] m_CategoricalActual
the actual values.
-
m_CategoricalPredicted
protected String[] m_CategoricalPredicted
the predicted values.
-
m_CategoricalProbabilities
protected double[] m_CategoricalProbabilities
the probabilities (optional).
-
m_CategoricalClassDistributions
protected double[][] m_CategoricalClassDistributions
the class distributions (optional).
-
m_CategoricalClassDistributionLabels
protected String[] m_CategoricalClassDistributionLabels
the class distribution labels (required if distributions provided).
-
-
Method Detail
-
clear
public void clear()
Clears all input.- Specified by:
clear
in interfaceSummaryStatistic
- Overrides:
clear
in classAbstractSummaryStatistic
-
setNumericActual
public void setNumericActual(double[] value)
Sets the actual values.- Specified by:
setNumericActual
in interfaceNumericSummaryStatistic
- Parameters:
value
- the actual
-
getNumericActual
public double[] getNumericActual()
Returns the actual values.- Specified by:
getNumericActual
in interfaceNumericSummaryStatistic
- Returns:
- the actual
-
setNumericPredicted
public void setNumericPredicted(double[] value)
Sets the predicted values.- Specified by:
setNumericPredicted
in interfaceNumericSummaryStatistic
- Parameters:
value
- the predicted
-
getNumericPredicted
public double[] getNumericPredicted()
Returns the predicted values.- Specified by:
getNumericPredicted
in interfaceNumericSummaryStatistic
- Returns:
- the predicted
-
setCategoricalActual
public void setCategoricalActual(String[] value)
Sets the actual values.- Specified by:
setCategoricalActual
in interfaceCategoricalSummaryStatistic
- Parameters:
value
- the actual
-
getCategoricalActual
public String[] getCategoricalActual()
Returns the actual values.- Specified by:
getCategoricalActual
in interfaceCategoricalSummaryStatistic
- Returns:
- the actual
-
setCategoricalPredicted
public void setCategoricalPredicted(String[] value)
Sets the predicted values.- Specified by:
setCategoricalPredicted
in interfaceCategoricalSummaryStatistic
- Parameters:
value
- the predicted
-
getCategoricalPredicted
public String[] getCategoricalPredicted()
Returns the predicted values.- Specified by:
getCategoricalPredicted
in interfaceCategoricalSummaryStatistic
- Returns:
- the predicted
-
setCategoricalProbabilities
public void setCategoricalProbabilities(double[] value)
Sets the probabilities.- Specified by:
setCategoricalProbabilities
in interfaceCategoricalSummaryStatistic
- Parameters:
value
- the probabilities
-
getCategoricalProbabilities
public double[] getCategoricalProbabilities()
Returns the probabilities.- Specified by:
getCategoricalProbabilities
in interfaceCategoricalSummaryStatistic
- Returns:
- the probabilities
-
setCategoricalClassDistributions
public void setCategoricalClassDistributions(double[][] value)
Sets the class distributions.- Specified by:
setCategoricalClassDistributions
in interfaceCategoricalSummaryStatistic
- Parameters:
value
- the class distributions
-
getCategoricalClassDistributions
public double[][] getCategoricalClassDistributions()
Returns the class distributions values.- Specified by:
getCategoricalClassDistributions
in interfaceCategoricalSummaryStatistic
- Returns:
- the class distributions
-
setCategoricalClassDistributionLabels
public void setCategoricalClassDistributionLabels(String[] value)
Sets the class labels (order in the class distributions).- Specified by:
setCategoricalClassDistributionLabels
in interfaceCategoricalSummaryStatistic
- Parameters:
value
- the class distribution labels
-
getCategoricalClassDistributionLabels
public String[] getCategoricalClassDistributionLabels()
Returns the class distributions values.- Specified by:
getCategoricalClassDistributionLabels
in interfaceCategoricalSummaryStatistic
- Returns:
- the class distribution labels
-
check
protected String check()
Hook method for performing checks before calculating statistic.- Overrides:
check
in classAbstractSummaryStatistic
- Returns:
- null if successful, otherwise error message
-
isNumeric
public boolean isNumeric()
Checks whether numeric predictions are available.- Returns:
- true if numeric predictions available
-
-