public class DominanceGlobalTermWeighter extends AbstractEntropyBasedGlobalTermWeighter
Modifier and Type | Field and Description |
---|---|
protected Vector |
dominance
A vector caching the global dominance weight of the document collection.
|
termEntropiesSum
documentCount, termDocumentFrequencies, termGlobalFrequencies
vectorFactory
Constructor and Description |
---|
DominanceGlobalTermWeighter()
Creates a new
DominanceGlobalTermWeighter . |
DominanceGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
Creates a new
DominanceGlobalTermWeighter . |
Modifier and Type | Method and Description |
---|---|
void |
add(Vector counts)
Adds a document to the model.
|
DominanceGlobalTermWeighter |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
int |
getDimensionality()
Gets the dimensionality of the global weights.
|
Vector |
getDominance()
Gets the dominance weight (global weight) vector for all of the terms.
|
Vector |
getGlobalWeights()
Gets the current vector of global weights.
|
boolean |
remove(Vector counts)
Removes the document from the model.
|
protected void |
setDominance(Vector dominance)
Sets the cached dominance weight vector.
|
getTermEntropiesSum, growVectors, initializeVectors, setTermEntropiesSum
getDocumentCount, getTermDocumentFrequencies, getTermGlobalFrequencies, setDocumentCount, setTermDocumentFrequencies, setTermGlobalFrequencies
getVectorFactory, setVectorFactory
add, addAll, remove, removeAll
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, addAll, remove, removeAll
protected Vector dominance
public DominanceGlobalTermWeighter()
DominanceGlobalTermWeighter
.public DominanceGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
DominanceGlobalTermWeighter
.vectorFactory
- The vector factory.public DominanceGlobalTermWeighter 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 AbstractEntropyBasedGlobalTermWeighter
public void add(Vector counts)
VectorSpaceModel
add
in interface VectorSpaceModel
add
in class AbstractEntropyBasedGlobalTermWeighter
counts
- Adds a document to the model.public boolean remove(Vector counts)
VectorSpaceModel
remove
in interface VectorSpaceModel
remove
in class AbstractEntropyBasedGlobalTermWeighter
counts
- The document to remove.public Vector getGlobalWeights()
GlobalTermWeighter
public int getDimensionality()
GlobalTermWeighter
public Vector getDominance()
protected void setDominance(Vector dominance)
dominance
- The cached dominance weight vector.