ir.classifiers
Class Example

java.lang.Object
  |
  +--ir.classifiers.Example

public class Example
extends java.lang.Object

An object to hold training or test examples for categorization. Stores the name, category and HashMapVector representation of the example.


Field Summary
protected  int category
          Category index of the example
protected  ir.vsr.FileDocument document
          fileDocument object for the example
protected  ir.vsr.HashMapVector hashVector
          Representation of the example as a vector of (feature -> weight) mappings
protected  java.lang.String name
          Name of the example
 
Constructor Summary
Example(ir.vsr.HashMapVector input, int cat, java.lang.String id, ir.vsr.FileDocument doc)
           
 
Method Summary
 int getCategory()
          Returns the category of the example
 ir.vsr.FileDocument getDocument()
          Returns the document of the example
 ir.vsr.HashMapVector getHashMapVector()
          Returns the hashVector of the example
 java.lang.String getName()
          Returns the name of the example
 void setCategory(int cat)
          Sets the category of the example
 void setDocument(ir.vsr.FileDocument doc)
          Sets the document of the example
 void setHashMapVector(ir.vsr.HashMapVector v)
          Sets the hashVector of the example
 void setName(java.lang.String id)
          Sets the name of the example
 java.lang.String toString()
          Returns the String representation of the example object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Name of the example

category

protected int category
Category index of the example

hashVector

protected ir.vsr.HashMapVector hashVector
Representation of the example as a vector of (feature -> weight) mappings

document

protected ir.vsr.FileDocument document
fileDocument object for the example
Constructor Detail

Example

public Example(ir.vsr.HashMapVector input,
               int cat,
               java.lang.String id,
               ir.vsr.FileDocument doc)
Method Detail

setName

public void setName(java.lang.String id)
Sets the name of the example

getName

public java.lang.String getName()
Returns the name of the example

setCategory

public void setCategory(int cat)
Sets the category of the example

getCategory

public int getCategory()
Returns the category of the example

setHashMapVector

public void setHashMapVector(ir.vsr.HashMapVector v)
Sets the hashVector of the example

getHashMapVector

public ir.vsr.HashMapVector getHashMapVector()
Returns the hashVector of the example

setDocument

public void setDocument(ir.vsr.FileDocument doc)
Sets the document of the example

getDocument

public ir.vsr.FileDocument getDocument()
Returns the document of the example

toString

public java.lang.String toString()
Returns the String representation of the example object
Overrides:
toString in class java.lang.Object