gov.sandia.cognition.text.term.vector.weighter.local
Class BinaryLocalTermWeighter

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.math.matrix.DefaultVectorFactoryContainer
          extended by gov.sandia.cognition.text.term.vector.weighter.local.AbstractLocalTermWeighter
              extended by gov.sandia.cognition.text.term.vector.weighter.local.BinaryLocalTermWeighter
All Implemented Interfaces:
VectorFactoryContainer, LocalTermWeighter, CloneableSerializable, Serializable, Cloneable

public class BinaryLocalTermWeighter
extends AbstractLocalTermWeighter

Makes the given term weights binary, by creating a vector that contains a 1.0 for all non-zero entries in the given vector and a 0.0 for the all the zeros. Used to indicate that a given term exists in a document, ignoring the frequency of occurrence.

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

Field Summary
 
Fields inherited from class gov.sandia.cognition.math.matrix.DefaultVectorFactoryContainer
vectorFactory
 
Constructor Summary
BinaryLocalTermWeighter()
          Creates a new BinaryLocalTermWeighter.
BinaryLocalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
          Creates a new BinaryLocalTermWeighter.
 
Method Summary
 Vector computeLocalWeights(Vector counts)
          Computes the new local weights for a given document.
 
Methods inherited from class gov.sandia.cognition.text.term.vector.weighter.local.AbstractLocalTermWeighter
computeLocalWeights
 
Methods inherited from class gov.sandia.cognition.math.matrix.DefaultVectorFactoryContainer
getVectorFactory, setVectorFactory
 
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

BinaryLocalTermWeighter

public BinaryLocalTermWeighter()
Creates a new BinaryLocalTermWeighter.


BinaryLocalTermWeighter

public BinaryLocalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
Creates a new BinaryLocalTermWeighter.

Parameters:
vectorFactory - The vector factory to use.
Method Detail

computeLocalWeights

public Vector computeLocalWeights(Vector counts)
Description copied from interface: LocalTermWeighter
Computes the new local weights for a given document.

Parameters:
counts - The document to compute local weights for.
Returns:
The local weight vector for the documents.