powered by
Tools for manipulating (sparse) count matrices.
normalize(x,byrow=TRUE) stm_tfidf(x)
A simple_triplet_matrix or matrix of counts.
simple_triplet_matrix
matrix
Whether to normalize by row or column totals.
normalize divides the counts by row or column totals, and stm_tfidf returns a matrix with entries \(x_{ij} \log[ n/(d_j+1) ]\), where \(x_{ij}\) is term-j frequency in document-i, and \(d_j\) is the number of documents containing term-j.
normalize
stm_tfidf
# NOT RUN { normalize( matrix(1:9, ncol=3) ) normalize( matrix(1:9, ncol=3), byrow=FALSE ) (x <- matrix(rbinom(15,size=2,prob=.25),ncol=3)) stm_tfidf(x) # }
Run the code above in your browser using DataLab