|
Oracle Data Mining Java API Reference 10g Release 1 (10.1) B12276-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.dmt.odm.MiningObject | +--oracle.dmt.odm.CategoryMatrix | +--oracle.dmt.odm.CostMatrix
Cost Matrix is used in a classification problem. It enables the user to let the algorithm know what the relative values of the various classes are to the user.
For example, suppose the problem is to predict whether a user will respond to a promotional mailing. The target has two classes: YES and NO. Suppose a positive response to the promotion generates $500 and the Category of the promotion is $5. Then the Category of misclassify a positive responder is $500. The Cost of misclassify a non-responder is $5.
The Cost matrix looks like
Actual/Predicted | Predicted Yes | Predicted No |
---|---|---|
Actual Yes | 0 | 5 |
Actual No | 500 | 0 |
From the above matrix table, we can see that (Category row, Category column) will have the following Cost Matrix values:
Cost Matrix of (Actual Yes, Predicted Yes) = 0
Cost Matrix of (Actual Yes, Predicted No) = 5.00
Cost Matrix of (Actual No, Predicted Yes) = 500.00
Cost Matrix of (Actual No, Predicted No) = 0
Some algorithms directly optimize for the Cost Matrix, modifying the model structure so as to directly produce minimal cost solutions. Other algorithms, like NB, that will predict probabilities, use the Cost Matrix during scoring to propose the least cost solution:
For example, suppose a model with the above cost matrix predicts a probability of YES of .05. Then the cost of predicting YES is 0.95 * $5 = $4.75 Whereas the cost of predicting no is:05 * $500 = $25. So the recommendation would be to send the promotion since the cost of sending out promotion is must less than the cost of not sending out promotion.
The default value of Cost Matrix will be a cost of missing an expected result
Constructor Summary | |
CostMatrix() Creates an empty instance of CostMatrix . |
Method Summary | |
void |
addEntry(Category rowValue, Category columnValue, java.lang.Object value) Adds a new entry to the cost matrix. |
void |
validate() Validates the cost matrix to ensure all entries have a valid value and all diagonal entries have a zero value. |
Methods inherited from class oracle.dmt.odm.CategoryMatrix |
addEntry, getDiagonalDefault, getOffDiagonalDefault, getValue, getValue, isPresent, listCategories, listColumnDisplayNames, listColumnValues, listDisplayNames, listRowDisplayNames, listRowValues, sumAllCells, sumForColumn, sumForRow, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CostMatrix()
CostMatrix
.Method Detail |
public void addEntry(Category rowValue, Category columnValue, java.lang.Object value) throws ODMException
ODMException
-
rowValue
or columnValue
is null,value
is negative,rowValue
and columnValue
do not have the same data type,public void validate() throws ODMException
validate
in class CategoryMatrix
ODMException
-
|
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |