public abstract class AbstractEntropyBasedGlobalTermWeighter extends AbstractFrequencyBasedGlobalTermWeighter
Modifier and Type | Field and Description |
---|---|
protected Vector |
termEntropiesSum
A vector containing the sum of the entropy term (f_ij * log(f_ij)) over
each document in the collection for each term.
|
documentCount, termDocumentFrequencies, termGlobalFrequencies
vectorFactory
Constructor and Description |
---|
AbstractEntropyBasedGlobalTermWeighter()
Creates a new
AbstractEntropyBasedGlobalTermWeighter . |
AbstractEntropyBasedGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
Creates a new
AbstractEntropyBasedGlobalTermWeighter . |
Modifier and Type | Method and Description |
---|---|
void |
add(Vector counts)
Adds a document to the model.
|
AbstractEntropyBasedGlobalTermWeighter |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
Vector |
getTermEntropiesSum()
Gets the vector containing the sum of term the entropies.
|
protected void |
growVectors(int newDimensionality)
Called when the dimensionality of the term vector grows.
|
protected void |
initializeVectors(int dimensionality)
Initializes internal vectors to the given dimensionality.
|
boolean |
remove(Vector counts)
Removes the document from the model.
|
protected void |
setTermEntropiesSum(Vector termEntropiesSum)
Sets the vector containing the sum of the term entropies.
|
getDocumentCount, getTermDocumentFrequencies, getTermGlobalFrequencies, setDocumentCount, setTermDocumentFrequencies, setTermGlobalFrequencies
getVectorFactory, setVectorFactory
add, addAll, remove, removeAll
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDimensionality, getGlobalWeights
add, addAll, remove, removeAll
protected Vector termEntropiesSum
public AbstractEntropyBasedGlobalTermWeighter()
AbstractEntropyBasedGlobalTermWeighter
.public AbstractEntropyBasedGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
AbstractEntropyBasedGlobalTermWeighter
.vectorFactory
- The vector factory to use.public AbstractEntropyBasedGlobalTermWeighter clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractFrequencyBasedGlobalTermWeighter
public void add(Vector counts)
VectorSpaceModel
add
in interface VectorSpaceModel
add
in class AbstractFrequencyBasedGlobalTermWeighter
counts
- Adds a document to the model.public boolean remove(Vector counts)
VectorSpaceModel
remove
in interface VectorSpaceModel
remove
in class AbstractFrequencyBasedGlobalTermWeighter
counts
- The document to remove.protected void initializeVectors(int dimensionality)
AbstractFrequencyBasedGlobalTermWeighter
initializeVectors
in class AbstractFrequencyBasedGlobalTermWeighter
dimensionality
- The dimensionality to initialize to.protected void growVectors(int newDimensionality)
AbstractFrequencyBasedGlobalTermWeighter
growVectors
in class AbstractFrequencyBasedGlobalTermWeighter
newDimensionality
- The new dimensionality;public Vector getTermEntropiesSum()
protected void setTermEntropiesSum(Vector termEntropiesSum)
termEntropiesSum
- The term entropies sum.