Learn R Programming

qtkit (version 1.1.1)

calc_idf: Calculate Inverse Document Frequency

Description

Computes the inverse document frequency (IDF) for each term in a term-document matrix. IDF is calculated as log(N/df) where N is the total number of documents and df is the document frequency of the term.

Usage

calc_idf(tdm)

Value

A numeric vector of inverse document frequencies for each term

Arguments

tdm

A term-document matrix