|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.dmt.odm.MiningObject | +--oracle.dmt.odm.CategoryMatrix
An instance of CategoryMatrix
represents a sparse square matrix
whose axes are categories. This class supports the confusion matrix, an
output of the test operation for a classification model, and the cost matrix,
an input of the build operation for a classification model.
Constructor Summary |
CategoryMatrix()
Creates an empty instance of CategoryMatrix . |
Method Summary |
Type | Method |
---|---|
void |
addEntry(Category rowValue,
Category columnValue,
float value)
Adds a new entry to the matrix. |
float |
getDiagonalDefault()
Deprecated. As of ODM 9.2.0, this method is not supported. |
float |
getOffDiagonalDefault()
Deprecated. As of ODM 9.2.0, this method is not supported. |
float |
getValue(Category row,
Category column)
Returns the value of the entry at the specified row Category and
column Category position. |
float |
getValue(java.lang.String row,
java.lang.String column)
Returns the value of the entry whose row and column display names match to the specified names. |
boolean |
isPresent(Category indexValue)
Returns true if the given index value is found in the matrix. |
Category[] |
listCategories()
Returns all row and column index values in the matrix. |
java.lang.String[] |
listColumnDisplayNames()
Deprecated. As of 9.2.0, replaced by listDisplayNames method. |
Category[] |
listColumnValues()
Deprecated. As of 9.2.0, replaced by listCategories method. |
java.lang.String[] |
listDisplayNames()
Returns all display names used in the matrix. |
java.lang.String[] |
listRowDisplayNames()
Deprecated. As of 9.2.0, replaced by listDisplayNames method. |
Category[] |
listRowValues()
Deprecated. As of 9.2.0, replaced by listCategories method. |
void |
restore(java.sql.Connection dbConnection,
int matrixID)
For internal use only. |
void |
restore(Connection dmsCon,
int matrixID)
For internal use only. |
float |
sumAllCells()
Returns the sum of all cells in the matrix. |
float |
sumForColumn(Category column)
Returns sum of all cells in the given column index of the matrix. |
float |
sumForRow(Category row)
Returns sum of all cells in the given row index of the matrix |
java.lang.String |
toString()
Returns a formatted string representation of a CategoryMatrix instance. |
void |
validate()
Validates the matrix to ensure all entries have a valid value and all diagonal entries have a zero value. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CategoryMatrix()
CategoryMatrix
.Method Detail |
public float getDiagonalDefault()
float
- The default value of the diagonal elementspublic float getOffDiagonalDefault()
float
- The default value of the off-diagonal elementspublic void addEntry(Category rowValue, Category columnValue, float value) throws ODMException
rowValue
- A row index in the matrixcolumnValue
- A column index in the matrixvalue
- The value in the matrix at
(rowValue
, columnValue
) positionODMException
- rowValue
or columnValue
is null,
value
is negative,
rowValue
and columnValue
do not have the same data type,
public float getValue(java.lang.String row, java.lang.String column)
row
- A row display name in the matrixcolumn
- A column display name in the matrixfloat
- The value in the matrix
at (row
, column
) position.public float getValue(Category row, Category column) throws ODMException
Category
and
column Category
position.row
- A row index in the matrixcolumn
- A column index in the matrixvalue
- The value at the specified positionODMException
- when no entry was found at the position (row
, column
).public void validate() throws ODMException
ODMException
- ODMException
- when the object is invalid.public Category[] listRowValues()
listCategories
method.
Category[]
- All row index valuespublic Category[] listColumnValues()
listCategories
method.
Category[]
- All column index valuespublic Category[] listCategories()
Category[]
- All index valuespublic void restore(java.sql.Connection dbConnection, int matrixID) throws java.sql.SQLException, InvalidArgumentException, ODMException
public void restore(Connection dmsCon, int matrixID) throws InvalidArgumentException, java.sql.SQLException, ODMException
public java.lang.String toString()
CategoryMatrix
instance.toString
in class java.lang.Object
String
- A formatted string of the instancepublic java.lang.String[] listRowDisplayNames()
listDisplayNames
method.
String[]
- An array of display namespublic java.lang.String[] listColumnDisplayNames()
listDisplayNames
method.
String[]
- An array of display namespublic java.lang.String[] listDisplayNames()
String[]
- An array of display namespublic float sumAllCells() throws ODMException
float
- The total value of all cells in the matrix.ODMException
- when an invalid value is found.public float sumForRow(Category row) throws ODMException
row
- A row index in the matrixfloat
- The total value of all cells in the given row index.ODMException
- when an invalid value is found.public float sumForColumn(Category column) throws ODMException
column
- A column index in the matrixfloat
- The total value of all cells in the given column index.ODMException
- when an invalid value is found.public boolean isPresent(Category indexValue)
cat
- An index value to be found in the matrixboolean
- true if cat
is found,
false otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |