class IDFModel extends Serializable
Represents an IDF model that can transform term frequency vectors.
- Annotations
- @Since("1.1.0")
- Source
- IDF.scala
- Alphabetic
- By Inheritance
- IDFModel
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- val docFreq: Array[Long]
- Annotations
- @Since("3.0.0")
- val idf: Vector
- Annotations
- @Since("1.1.0")
- val numDocs: Long
- Annotations
- @Since("3.0.0")
- def transform(dataset: JavaRDD[Vector]): JavaRDD[Vector]
Transforms term frequency (TF) vectors to TF-IDF vectors (Java version).
Transforms term frequency (TF) vectors to TF-IDF vectors (Java version).
- dataset
a JavaRDD of term frequency vectors
- returns
a JavaRDD of TF-IDF vectors
- Annotations
- @Since("1.1.0")
- def transform(v: Vector): Vector
Transforms a term frequency (TF) vector to a TF-IDF vector
Transforms a term frequency (TF) vector to a TF-IDF vector
- v
a term frequency vector
- returns
a TF-IDF vector
- Annotations
- @Since("1.3.0")
- def transform(dataset: RDD[Vector]): RDD[Vector]
Transforms term frequency (TF) vectors to TF-IDF vectors.
Transforms term frequency (TF) vectors to TF-IDF vectors.
If
minDocFreq
was set for the IDF calculation, the terms which occur in fewer thanminDocFreq
documents will have an entry of 0.- dataset
an RDD of term frequency vectors
- returns
an RDD of TF-IDF vectors
- Annotations
- @Since("1.1.0")