Simple calculation of document weights based on the average number of words in a document within the corpus (mean value = 1).
document_weights(document_term_table)
document_term_table | Table of observation count data (rows:
documents, columns: terms. May be a class |
---|
Vector of weights, one for each document, with the average sample receiving a weight of 1.0.
data(rodents) document_weights(rodents$document_term_table)