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

Field Summary
 
Fields inherited from class dragon.ir.classification.multiclass.AbstractCodeMatrix
classifierNum, classNum
 
Constructor Summary
AllPairCodeMatrix()
           
AllPairCodeMatrix(int classNum)
           
 
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 dragon.ir.classification.multiclass.AbstractCodeMatrix
getClassifierNum, getClassNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllPairCodeMatrix

public AllPairCodeMatrix()

AllPairCodeMatrix

public AllPairCodeMatrix(int classNum)
Method Detail

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 category
classifierIndex - 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.