class HashingTF extends Serializable
Maps a sequence of terms to their term frequencies using the hashing trick.
- Annotations
- @Since( "1.1.0" )
- Source
- HashingTF.scala
- Alphabetic
- By Inheritance
- HashingTF
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
def
indexOf(term: Any): Int
Returns the index of the input term.
Returns the index of the input term.
- Annotations
- @Since( "1.1.0" )
- val numFeatures: Int
-
def
setBinary(value: Boolean): HashingTF.this.type
If true, term frequency vector will be binary such that non-zero term counts will be set to 1 (default: false)
If true, term frequency vector will be binary such that non-zero term counts will be set to 1 (default: false)
- Annotations
- @Since( "2.0.0" )
-
def
setHashAlgorithm(value: String): HashingTF.this.type
Set the hash algorithm used when mapping term to integer.
Set the hash algorithm used when mapping term to integer. (default: murmur3)
- Annotations
- @Since( "2.0.0" )
-
def
transform[D <: Iterable[_]](dataset: JavaRDD[D]): JavaRDD[Vector]
Transforms the input document to term frequency vectors (Java version).
Transforms the input document to term frequency vectors (Java version).
- Annotations
- @Since( "1.1.0" )
-
def
transform[D <: Iterable[_]](dataset: RDD[D]): RDD[Vector]
Transforms the input document to term frequency vectors.
Transforms the input document to term frequency vectors.
- Annotations
- @Since( "1.1.0" )
-
def
transform(document: Iterable[_]): Vector
Transforms the input document into a sparse term frequency vector (Java version).
Transforms the input document into a sparse term frequency vector (Java version).
- Annotations
- @Since( "1.1.0" )
-
def
transform(document: Iterable[_]): Vector
Transforms the input document into a sparse term frequency vector.
Transforms the input document into a sparse term frequency vector.
- Annotations
- @Since( "1.1.0" )