I'd like to compute a TFIDF matrix (
tfidf_matrix_b) based on a previously computed TFIDF matrix (
tfidf_matrix_a). Is there a good way to do this using prebuilt R functions / a good algorithm to do so? I am aware of packages such as
tm (in fact, it is my difficulty in using
tm that prompted this post). I can certainly write a function for myself that will:
corpus_b using a dictionary created from
tfidf_matrix_b by dividing
tf_matrix_b by the document frequencies calculated from
However, I would have thought there would be a more elegant solution / this already existed in something like
tm. Does anyone have a more elegant solution?
If it's helpful, this is for the purposes of text classification, classifying new data based upon a model trained on old data. Gotta have the new data in same form as old data to do so!