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, termGlobalFrequenciesvectorFactory| 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, setTermGlobalFrequenciesgetVectorFactory, setVectorFactoryadd, addAll, remove, removeAllequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDimensionality, getGlobalWeightsadd, addAll, remove, removeAllprotected Vector termEntropiesSum
public AbstractEntropyBasedGlobalTermWeighter()
AbstractEntropyBasedGlobalTermWeighter.public AbstractEntropyBasedGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
AbstractEntropyBasedGlobalTermWeighter.vectorFactory - The vector factory to use.public AbstractEntropyBasedGlobalTermWeighter clone()
AbstractCloneableSerializableObject 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 CloneableSerializableclone in class AbstractFrequencyBasedGlobalTermWeighterpublic void add(Vector counts)
VectorSpaceModeladd in interface VectorSpaceModeladd in class AbstractFrequencyBasedGlobalTermWeightercounts - Adds a document to the model.public boolean remove(Vector counts)
VectorSpaceModelremove in interface VectorSpaceModelremove in class AbstractFrequencyBasedGlobalTermWeightercounts - The document to remove.protected void initializeVectors(int dimensionality)
AbstractFrequencyBasedGlobalTermWeighterinitializeVectors in class AbstractFrequencyBasedGlobalTermWeighterdimensionality - The dimensionality to initialize to.protected void growVectors(int newDimensionality)
AbstractFrequencyBasedGlobalTermWeightergrowVectors in class AbstractFrequencyBasedGlobalTermWeighternewDimensionality - The new dimensionality;public Vector getTermEntropiesSum()
protected void setTermEntropiesSum(Vector termEntropiesSum)
termEntropiesSum - The term entropies sum.