javax.datamining.supervised.classification
Interface ClassificationTestTask

All Superinterfaces:
MiningObject, Task, TestTask

public interface ClassificationTestTask
extends TestTask

A ClassificationTestTask is a mining task used for testing a classification model to measure the goodness of the model. The results of executing a classification test task include the accuracy of the model and a confusion matrix which is the statistics of the predictions made during the test.

Author:
JSR-73 Java Data Mining Expert Group
See Also:
MiningObject, Task, TestTask

Method Summary
 boolean computeMetric(ClassificationTestMetricOption testMetric)
          Returns true if the test metric is to be computed, false otherwise.
 void computeMetric(ClassificationTestMetricOption testMetric, boolean flag)
          Indicates which metric(s) to compute as indicated by the testMetric and corresponding flag.
 java.lang.String getCostMatrixName()
          Returns the name of the cost matrix to be used for test.
 int getNumberOfLiftQuantiles()
          Returns the number of quantiles for lift computation.
 java.lang.Object getPositiveTargetValue()
          Returns the positive target value for lift computation.
 void setCostMatrixName(java.lang.String costMatrixName)
          Sets the name of the cost matrix to be used for test.
 void setNumberOfLiftQuantiles(int numberOfQuantiles)
          Sets the number of quantiles for lift computation.
 void setPositiveTargetValue(java.lang.Object positiveTargetValue)
          Sets the positive target value for lift computation.
 
Methods inherited from interface javax.datamining.supervised.TestTask
getModelName, getTestDataMap, getTestDataName, getTestMetricsName, setModelName, setTestDataMap, setTestDataName, setTestMetricsName, verify
 
Methods inherited from interface javax.datamining.base.Task
getExecutionHandle
 
Methods inherited from interface javax.datamining.MiningObject
getCreationDate, getCreatorInfo, getDescription, getName, getObjectIdentifier, getObjectType, setDescription
 

Method Detail

computeMetric

public boolean computeMetric(ClassificationTestMetricOption testMetric)
Returns true if the test metric is to be computed, false otherwise.

Parameters:
testMetric -
Returns:
boolean

computeMetric

public void computeMetric(ClassificationTestMetricOption testMetric,
                          boolean flag)
Indicates which metric(s) to compute as indicated by the testMetric and corresponding flag. If flag is true, the metric is computed. If false, it is not computed. The default for all metrics is false. The method is idempotent for the same parameters. It may be invoked multiple times to compute more than one test metric.

Parameters:
testMetric -
flag -
Returns:
void

getCostMatrixName

public java.lang.String getCostMatrixName()
Returns the name of the cost matrix to be used for test. Returns null if no cost matrix has been set via setCostMatrixName method.

Returns:
String

getNumberOfLiftQuantiles

public int getNumberOfLiftQuantiles()
Returns the number of quantiles for lift computation. Return 0 if lift computation is disabled.

Returns:
int

getPositiveTargetValue

public java.lang.Object getPositiveTargetValue()
Returns the positive target value for lift computation.

Returns:
Object

setCostMatrixName

public void setCostMatrixName(java.lang.String costMatrixName)
                       throws JDMException
Sets the name of the cost matrix to be used for test. This cost matrix overrides the cost matrix associated with the model, if any. Such override can be nullified if null is specified. If the model has taken into account a cost matrix, this cost matrix may not be used for test.

Parameters:
costMatrixName -
Returns:
void
Throws:
JDMException

setNumberOfLiftQuantiles

public void setNumberOfLiftQuantiles(int numberOfQuantiles)
Sets the number of quantiles for lift computation. The number must be a positive integer greater than 1.

Parameters:
numberOfQuantiles - The number of quantiles for lift computation.
Returns:
void

setPositiveTargetValue

public void setPositiveTargetValue(java.lang.Object positiveTargetValue)
Sets the positive target value for lift computation.

Parameters:
positiveTargetValue - The positive target value for lift computation.
Returns:
void