ir.classifiers
Class Example

java.lang.Object
  extended by 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  FileDocument document
          fileDocument object for the example
protected  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(HashMapVector input, int cat, java.lang.String id, FileDocument doc)
           
 
Method Summary
 int getCategory()
          Returns the category of the example
 FileDocument getDocument()
          Returns the document of the example
 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(FileDocument doc)
          Sets the document of the example
 void setHashMapVector(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 HashMapVector hashVector
Representation of the example as a vector of (feature -> weight) mappings


document

protected FileDocument document
fileDocument object for the example

Constructor Detail

Example

public Example(HashMapVector input,
               int cat,
               java.lang.String id,
               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(HashMapVector v)
Sets the hashVector of the example


getHashMapVector

public HashMapVector getHashMapVector()
Returns the hashVector of the example


setDocument

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


getDocument

public 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