gov.sandia.cognition.text.term.vector.weighter.normalize
Class UnitTermWeightNormalizer

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.text.term.vector.weighter.normalize.AbstractTermWeightNormalizer
          extended by gov.sandia.cognition.text.term.vector.weighter.normalize.UnitTermWeightNormalizer
All Implemented Interfaces:
TermWeightNormalizer, CloneableSerializable, Serializable, Cloneable

public class UnitTermWeightNormalizer
extends AbstractTermWeightNormalizer

Normalizes term weights to be a unit vector. It is the most common form of normalization.

Since:
3.0
Author:
Justin Basilico
See Also:
Serialized Form

Constructor Summary
UnitTermWeightNormalizer()
          Creates a new UnitTermWeightNormalizer.
 
Method Summary
 void normalizeWeights(Vector weights, Vector counts, Vector globalWeights)
          Normalizes the given weight vector.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

UnitTermWeightNormalizer

public UnitTermWeightNormalizer()
Creates a new UnitTermWeightNormalizer.

Method Detail

normalizeWeights

public void normalizeWeights(Vector weights,
                             Vector counts,
                             Vector globalWeights)
Description copied from interface: TermWeightNormalizer
Normalizes the given weight vector. Can make use of the supporting information such as the term counts for the document, and the global weights used to compute the weights (if any). However, it does not have to use this information if it does not need to.

Parameters:
weights - The weights to normalize. Contains an input and should be modified to create an output. Cannot be null.
counts - The term counts for the document to normalize. Cannot be null.
globalWeights - The global weights to use in to create the weights, if any. Can be null.