class IDF extends AnyRef
Inverse document frequency (IDF).
The standard formulation is used: idf = log((m + 1) / (d(t) + 1))
, where m
is the total
number of documents and d(t)
is the number of documents that contain term t
.
This implementation supports filtering out terms which do not appear in a minimum number
of documents (controlled by the variable minDocFreq
). For terms that are not in
at least minDocFreq
documents, the IDF is found as 0, resulting in TF-IDFs of 0.
The document frequency is 0 as well for such terms
- Annotations
- @Since( "1.1.0" )
- Source
- IDF.scala
- Alphabetic
- By Inheritance
- IDF
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
def
fit(dataset: JavaRDD[Vector]): IDFModel
Computes the inverse document frequency.
Computes the inverse document frequency.
- dataset
a JavaRDD of term frequency vectors
- Annotations
- @Since( "1.1.0" )
-
def
fit(dataset: RDD[Vector]): IDFModel
Computes the inverse document frequency.
Computes the inverse document frequency.
- dataset
an RDD of term frequency vectors
- Annotations
- @Since( "1.1.0" )
-
val
minDocFreq: Int
- Annotations
- @Since( "1.2.0" )