at.tuwien.ifs.somtoolbox.data
Class TemplateVectorElement

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.data.TemplateVectorElement
All Implemented Interfaces:
Comparable<TemplateVectorElement>

public class TemplateVectorElement
extends Object
implements Comparable<TemplateVectorElement>

This class represents one element or attribute of the TemplateVector.

Version:
$Id: TemplateVectorElement.java 3883 2010-11-02 17:13:23Z frank $
Author:
Rudolf Mayer

Field Summary
private  int collectionTermFrequency
          The term frequency in the whole collection - how often does this attribute show up in the whole collection of feature vectors, i.e.
private  String comment
          Optional comment for this attribute.
private  int documentFrequency
          Indicates in how many documents or feature vectors this attribute is present, i.e.
private  int index
           
private  String label
          The label or name associated with this attribute.
private  int maximumTermFrequency
          Maximum value of this attribute in the collection of feature vectors.
private  double meanTermFrequency
          Mean value of this attribute in the collection of feature vectors.
private  int minimumTermFrequency
          Minimum value of this attribute in the collection of feature vectors.
private  TemplateVector tv
           
 
Constructor Summary
TemplateVectorElement(TemplateVector tv, String label, int index)
           
TemplateVectorElement(TemplateVector tv, String label, int index, int documentFrequency, int documentTermFrequency)
           
 
Method Summary
 int compareTo(TemplateVectorElement o)
          Compares two TemplateVectorElements by comparing the two labels.
 int getCollectionTermFrequency()
          Gets the term frequency in the whole collection.
 String getComment()
          Gets the comment.
 int getDocumentFrequency()
          Gets the document frequency.
 int getIndex()
           
 String getLabel()
          Gets the label.
 int getMaximumTermFrequency()
          Gets the maximum tf.
 double getMeanTermFrequency()
          Gets the mean tf.
 int getMinimumTermFrequency()
          Gets the minimum tf.
 TemplateVector getTemplateVector()
          Returns the TemplateVector this element is associated to.
 void mergeStatiscticsWithOtherElement(TemplateVectorElement other)
          Merge the statistical information of the current template vector element with another element, used e.g.
 void setCollectionTermFrequency(int collectionTermFrequency)
           
 void setComment(String comment)
           
 void setDocumentFrequency(int documentFrequency)
           
protected  void setLabel(String label)
           
 void setMaximumTermFrequency(int maximumTermFrequency)
           
 void setMeanTermFrequency(double meanTermFrequency)
           
 void setMinimumTermFrequency(int minimumTermFrequency)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tv

private final TemplateVector tv

label

private String label
The label or name associated with this attribute.


documentFrequency

private int documentFrequency
Indicates in how many documents or feature vectors this attribute is present, i.e. has an input vector value <> 0.


collectionTermFrequency

private int collectionTermFrequency
The term frequency in the whole collection - how often does this attribute show up in the whole collection of feature vectors, i.e. a counter for the attribute, the sum of all values of the attribute (sum across all feature vectors).


minimumTermFrequency

private int minimumTermFrequency
Minimum value of this attribute in the collection of feature vectors.


maximumTermFrequency

private int maximumTermFrequency
Maximum value of this attribute in the collection of feature vectors.


meanTermFrequency

private double meanTermFrequency
Mean value of this attribute in the collection of feature vectors.


comment

private String comment
Optional comment for this attribute.


index

private int index
Constructor Detail

TemplateVectorElement

public TemplateVectorElement(TemplateVector tv,
                             String label,
                             int index)

TemplateVectorElement

public TemplateVectorElement(TemplateVector tv,
                             String label,
                             int index,
                             int documentFrequency,
                             int documentTermFrequency)
Method Detail

getIndex

public int getIndex()

getDocumentFrequency

public int getDocumentFrequency()
Gets the document frequency.

Returns:
the document frequency

setDocumentFrequency

public void setDocumentFrequency(int documentFrequency)

getCollectionTermFrequency

public int getCollectionTermFrequency()
Gets the term frequency in the whole collection.

Returns:
the frequency of this term in the whole collection

setCollectionTermFrequency

public void setCollectionTermFrequency(int collectionTermFrequency)

getLabel

public String getLabel()
Gets the label.

Returns:
the label of this attribute

setLabel

protected void setLabel(String label)

getComment

public String getComment()
Gets the comment.

Returns:
the comment attached to this attribute

setComment

public void setComment(String comment)

getMaximumTermFrequency

public int getMaximumTermFrequency()
Gets the maximum tf.

Returns:
the maximum value of this attribute in the collection of feature vectors

setMaximumTermFrequency

public void setMaximumTermFrequency(int maximumTermFrequency)

getMeanTermFrequency

public double getMeanTermFrequency()
Gets the mean tf.

Returns:
the mean value of this attribute in the collection of feature vectors

setMeanTermFrequency

public void setMeanTermFrequency(double meanTermFrequency)

getMinimumTermFrequency

public int getMinimumTermFrequency()
Gets the minimum tf.

Returns:
the minimum value of this attribute in the collection of feature vectors

setMinimumTermFrequency

public void setMinimumTermFrequency(int minimumTermFrequency)

compareTo

public int compareTo(TemplateVectorElement o)
Compares two TemplateVectorElements by comparing the two labels.

Specified by:
compareTo in interface Comparable<TemplateVectorElement>
See Also:
String.compareTo(String)

toString

public String toString()
Overrides:
toString in class Object

mergeStatiscticsWithOtherElement

public void mergeStatiscticsWithOtherElement(TemplateVectorElement other)
Merge the statistical information of the current template vector element with another element, used e.g. in SOMLibInputMerger.


getTemplateVector

public TemplateVector getTemplateVector()
Returns the TemplateVector this element is associated to.