dragon.ir.classification.multiclass
Class AllPairCodeMatrix
java.lang.Object
|
+--dragon.ir.classification.multiclass.AbstractCodeMatrix
|
+--dragon.ir.classification.multiclass.AllPairCodeMatrix
- All Implemented Interfaces:
- CodeMatrix, java.io.Serializable
- public class AllPairCodeMatrix
- extends AbstractCodeMatrix
- implements java.io.Serializable
Pairwise Code Matrix
Any two categories combine as a binary classifer in which one category is trained as postive examples and the other negative examples.
For a classification problem with n categories, there are total n(n-1)/2 binary classifiers.
Copyright: Copyright (c) 2005
Company: IST, Drexel University
- Version:
- 1.0
- Author:
- Davis Zhou
- See Also:
- Serialized Form
|
Method Summary |
int |
getCode(int classIndex,
int classifierIndex)
Gets the code value for specified category and binary classifier |
void |
setClassNum(int classNum)
Sets the number of categories |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AllPairCodeMatrix
public AllPairCodeMatrix()
AllPairCodeMatrix
public AllPairCodeMatrix(int classNum)
setClassNum
public void setClassNum(int classNum)
- Description copied from interface:
CodeMatrix
- Sets the number of categories
- Specified by:
setClassNum in interface CodeMatrix
- Parameters:
classNum - the number of categories
getCode
public int getCode(int classIndex,
int classifierIndex)
- Description copied from interface:
CodeMatrix
- Gets the code value for specified category and binary classifier
- Specified by:
getCode in interface CodeMatrix
- Parameters:
classIndex - the index of the categoryclassifierIndex - the index of the binary classifier
- Returns:
- -1, 0, +1. -1 means the training examples of category i will be used as negative examples for the j-th binary classifier.
+1 means the training examples of category i will be used as positive examples for the j-th binary classifier. O means not used
for training.