For example, the functions that construct the traditional TFIDF cosine similarity can be: where N is the size of the document collection for deriving document frequencies, tf and df are the functions computing the term frequency and document frequency, respectively.
tWEAK also takes a specified vector function f sim but assumes a parametric termweighting function tw w .