@PublicationReference(author="Wikipedia", title="tf-idf", type=WebPage, url="http://en.wikipedia.org/wiki/tf-idf", year=2009) public class InverseDocumentFrequencyGlobalTermWeighter extends AbstractFrequencyBasedGlobalTermWeighter
| Modifier and Type | Field and Description |
|---|---|
protected Vector |
inverseDocumentFrequency
The (cached) value of the inverse document frequency.
|
documentCount, termDocumentFrequencies, termGlobalFrequenciesvectorFactory| Constructor and Description |
|---|
InverseDocumentFrequencyGlobalTermWeighter()
Creates a new
InverseDocumentFrequencyGlobalTermWeighter. |
InverseDocumentFrequencyGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
Creates a new
InverseDocumentFrequencyGlobalTermWeighter. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Vector counts)
Adds a document to the model.
|
InverseDocumentFrequencyGlobalTermWeighter |
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 |
getGlobalWeights()
Gets the current vector of global weights.
|
Vector |
getInverseDocumentFrequency()
Gets the inverse-document-frequency (IDF) global weight values.
|
boolean |
remove(Vector counts)
Removes the document from the model.
|
protected void |
setInverseDocumentFrequency(Vector inverseDocumentFrequency)
Sets the cached inverse-document-frequency (IDF) global weight values.
|
getDocumentCount, getTermDocumentFrequencies, getTermGlobalFrequencies, growVectors, initializeVectors, setDocumentCount, setTermDocumentFrequencies, setTermGlobalFrequenciesgetVectorFactory, setVectorFactoryadd, addAll, remove, removeAllequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, addAll, remove, removeAllprotected Vector inverseDocumentFrequency
public InverseDocumentFrequencyGlobalTermWeighter()
InverseDocumentFrequencyGlobalTermWeighter.public InverseDocumentFrequencyGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
InverseDocumentFrequencyGlobalTermWeighter.vectorFactory - The vector factory to use.public InverseDocumentFrequencyGlobalTermWeighter 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.public int getDimensionality()
GlobalTermWeighterpublic Vector getGlobalWeights()
GlobalTermWeighterpublic Vector getInverseDocumentFrequency()
protected void setInverseDocumentFrequency(Vector inverseDocumentFrequency)
inverseDocumentFrequency - The cached inverse-document-frequency (IDF) global weight values.