javax.datamining.supervised.classification
Interface ClassificationApplySettings

All Superinterfaces:
ApplySettings, MiningObject

public interface ClassificationApplySettings
extends ApplySettings

ClassificationApplySettings captures a specification that prescribes the output of an apply task specific to a classification model.

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

Method Summary
 ClassificationApplyContent getContent(java.lang.String destinationAttrName)
          Returns the apply content type designated to the specified physical attribute.
 ClassificationApplyContent[] getContentsByCategory(java.lang.Object categoryValue)
          Returns the types of apply content to be included in the apply output for the specified target class.
 ClassificationApplyContent[] getContentsByRank(int rank)
          Returns an array of apply content types to appear in the apply output for the specified rank.
 java.lang.String getCostMatrixName()
          Returns the name of the cost matrix to be used for apply.
 java.lang.String getMappedBaseDestinationAttributeName(ClassificationApplyContent content)
          Returns the base attribute name to be used for the values associated with the specified apply content that has been specified by mapPredictions method.
 java.lang.Object[] getMappedCategories()
          Returns an array of categories mapped by mapByCategory method.
 ClassificationApplyContent[] getMappedContents()
          Returns an array of apply contents that are used for mapping.
 java.lang.String getMappedDestinationAttrName(java.lang.Object categoryValue, ClassificationApplyContent contentType)
          Returns the name of the physical attribute mapped to the specified category.
 java.lang.Integer getRank(java.lang.String destinationAttrName)
          Returns the rank designated to the specified physical attribute.
 java.lang.Integer getRanks()
          Returns the number of predictions specified by mapByRank method.
 boolean isFromTop()
          Returns true if predictions are ordered from top, false if from bottom.
 void mapByCategory(ClassificationApplyContent content, java.lang.Object categoryValue, java.lang.String destinationAttrName)
          Maps the specified generated value for the specified target value to a destination attribute regardless of its rank.
 void mapByRank(ClassificationApplyContent content, java.lang.String[] destPhysAttrNameArray, boolean fromTop)
          Maps the specified generated values for the predictions within the specified ranks to a set of destination attributes.
 void mapPredictions(ClassificationApplyContent content, java.lang.String baseDestPhysAttrName)
          Maps all predictions in the model and the specified content value to a set of named destination attributes.
 void mapTopPrediction(ClassificationApplyContent content, java.lang.String destPhysAttrName)
          Maps the prediction with the highest probability to appear in the apply output under the specified attribute name.
 void setCostMatrixName(java.lang.String costMatrixName)
          Sets the name of the cost matrix to be used for apply, if supportsCapability for costMatrix returns true.
 
Methods inherited from interface javax.datamining.task.apply.ApplySettings
getSourceDestinationMap, resetMapping, setSourceDestinationMap, verify
 
Methods inherited from interface javax.datamining.MiningObject
getCreationDate, getCreatorInfo, getDescription, getName, getObjectIdentifier, getObjectType, setDescription
 

Method Detail

getContent

public ClassificationApplyContent getContent(java.lang.String destinationAttrName)
                                      throws JDMException
Returns the apply content type designated to the specified physical attribute.

The attribute name must not be null.

Parameters:
destinationAttrName - The name of the physical attribute whose designated content type is to be returned.
Returns:
ClassificationApplyContent
Throws:
JDMException

getContentsByCategory

public ClassificationApplyContent[] getContentsByCategory(java.lang.Object categoryValue)
                                                   throws JDMException
Returns the types of apply content to be included in the apply output for the specified target class. Throws an exception if the target value is not valid.

Parameters:
categoryValue - The target class whose associated apply contents are to be returned.
Returns:
ClassificationApplyContent[]
Throws:
JDMException

getContentsByRank

public ClassificationApplyContent[] getContentsByRank(int rank)
                                               throws JDMException
Returns an array of apply content types to appear in the apply output for the specified rank. Returns null if mapByRank has not been invoked.

The rank must be greater than or equal to 1.

Parameters:
rank - The rank of the prediction whose content types are to be returned.
Returns:
ClassificationApplyContent[]
Throws:
JDMException

getCostMatrixName

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

Returns:
String

getMappedBaseDestinationAttributeName

public java.lang.String getMappedBaseDestinationAttributeName(ClassificationApplyContent content)
Returns the base attribute name to be used for the values associated with the specified apply content that has been specified by mapPredictions method. Returns null if the method has not been invoked.

Parameters:
content -
Returns:
String

getMappedCategories

public java.lang.Object[] getMappedCategories()
Returns an array of categories mapped by mapByCategory method. Returns null otherwise.

Returns:
Object[]

getMappedContents

public ClassificationApplyContent[] getMappedContents()
Returns an array of apply contents that are used for mapping.

Returns:
ClassificationApplyContent[]

getMappedDestinationAttrName

public java.lang.String getMappedDestinationAttrName(java.lang.Object categoryValue,
                                                     ClassificationApplyContent contentType)
                                              throws JDMException
Returns the name of the physical attribute mapped to the specified category.

Parameters:
categoryValue - The target value to be represented as the destination attribute.
contentType - The content type to be represented as the destination attribute.
Returns:
String
Throws:
JDMException

getRank

public java.lang.Integer getRank(java.lang.String destinationAttrName)
                          throws JDMException
Returns the rank designated to the specified physical attribute. distinationAttrName must not be null.

Parameters:
destinationAttrName - The name of the physical attribute whose designated rank is to be returned.
Returns:
Integer
Throws:
JDMException

getRanks

public java.lang.Integer getRanks()
Returns the number of predictions specified by mapByRank method. Returns null if no such method has been invoked.

Returns:
Integer

isFromTop

public boolean isFromTop()
Returns true if predictions are ordered from top, false if from bottom. The default value is true, meaning that the predictions are ordered in descending order of the prediction criterion.

Returns:
boolean

mapByCategory

public void mapByCategory(ClassificationApplyContent content,
                          java.lang.Object categoryValue,
                          java.lang.String destinationAttrName)
                   throws JDMException
Maps the specified generated value for the specified target value to a destination attribute regardless of its rank. This method is used when a specific target value is of special interest.

For example, if the target attribute is color, a user may want to map the probability of the specific target value green to a destination attribute.

If this method is invoked on the same pair of content and categoryValue, or the destination attribute is duplicate, an exception is thrown.

Parameters:
content - A system-generated content to be included in the apply output.
categoryValue - The category value to be mapped.
destinationAttrName -
Returns:
void
Throws:
JDMException

mapByRank

public void mapByRank(ClassificationApplyContent content,
                      java.lang.String[] destPhysAttrNameArray,
                      boolean fromTop)
               throws JDMException
Maps the specified generated values for the predictions within the specified ranks to a set of destination attributes. The number of ranks depends on the cardinality of destination attributes.

For example, a user may want to map the predicted target values of the top 3 predictions (rank=1,2,3) to 3 destination attributes in the apply output, respectively.

If this method is invoked on the same content, the previous mapping is replaced with the new one.

Throws an exception if any destination attribute is duplicate.

Parameters:
content - A system-generated content to be included in the apply output.
destPhysAttrNameArray - An array of destination attributes.
fromTop - Indicates top predictions with the highest probabilities if true, or bottom predictions with lowest probabilities if false. If true/false, the top/bottom prediction is assigned to the first destination attribute (with index 0).
Returns:
void
Throws:
JDMException

mapPredictions

public void mapPredictions(ClassificationApplyContent content,
                           java.lang.String baseDestPhysAttrName)
                    throws JDMException
Maps all predictions in the model and the specified content value to a set of named destination attributes. The names are created in such a way that the base destination name is suffixed with a number that starts from 1.

If the same content is used, the previous mapping is replaced with the new one.

Parameters:
content -
baseDestPhysAttrName -
Returns:
void
Throws:
JDMException

mapTopPrediction

public void mapTopPrediction(ClassificationApplyContent content,
                             java.lang.String destPhysAttrName)
                      throws JDMException
Maps the prediction with the highest probability to appear in the apply output under the specified attribute name.

Throws an exception if the destination attribute is duplicate.

Parameters:
content - The content type of the top prediction.
destPhysAttrName - The attribute name of the content type for the top prediction.
Returns:
void
Throws:
JDMException

setCostMatrixName

public void setCostMatrixName(java.lang.String costMatrixName)
                       throws JDMException
Sets the name of the cost matrix to be used for apply, if supportsCapability for costMatrix returns true.

If null is specified, the previously set cost matrix name becomes nullified.

Parameters:
costMatrixName -
Returns:
void
Throws:
JDMException