@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, termGlobalFrequencies
vectorFactory
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, setTermGlobalFrequencies
getVectorFactory, setVectorFactory
add, addAll, remove, removeAll
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, addAll, remove, removeAll
protected Vector inverseDocumentFrequency
public InverseDocumentFrequencyGlobalTermWeighter()
InverseDocumentFrequencyGlobalTermWeighter
.public InverseDocumentFrequencyGlobalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
InverseDocumentFrequencyGlobalTermWeighter
.vectorFactory
- The vector factory to use.public InverseDocumentFrequencyGlobalTermWeighter 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.public int getDimensionality()
GlobalTermWeighter
public Vector getGlobalWeights()
GlobalTermWeighter
public Vector getInverseDocumentFrequency()
protected void setInverseDocumentFrequency(Vector inverseDocumentFrequency)
inverseDocumentFrequency
- The cached inverse-document-frequency (IDF) global weight values.