Transforms a term-frequency model into a term-frequency
inverse-document-frequency model.
A TF-IDF model is term frequency model whose rows, corresponding
to word types, are scaled by IDF values. The idea is that a word
type which occurs in most of the contexts (i.e., documents) does
less to distinguish the contexts semantically than does a word
type which occurs in few of the contexts. The document frequency
is the number of documents in which a word occurs divided by the
number of documents. The IDF is the log of the inverse of the
document frequency.
As with a term-frequency model, word types correspond to matrix
rows and contexts correspond to matrix columns.
The data structure is a sparse float matrix.
:See Also: :class:`vsm.model.TfSeq`, :class:`vsm.model.base`,
:class:`scipy.sparse.coo_matrix`
:notes:
A zero in the matrix might arise in two ways: (1) the word type
occurs in every document, in which case the IDF value is 0; (2)
the word type occurs in no document at all, in which case the IDF
value is undefined.