Class: HashingTF

eclairjs/ml/feature. HashingTF

Maps a sequence of terms to their term frequencies using the hashing trick. Currently we use Austin Appleby's MurmurHash 3 algorithm (MurmurHash3_x86_32) to calculate the hash code value for the term object. Since a simple modulo is used to transform the hash function to a column index, it is advisable to use a power of two as the numFeatures parameter; otherwise the features will not be mapped evenly to the columns.

Constructor

new HashingTF(uidopt)

Parameters:
Name Type Attributes Description
uid string <optional>
Source:

Extends

Methods

(static) load(path) → {module:eclairjs/mllib/feature.HashingTF}

Parameters:
Name Type Description
path string
Source:
Returns:
Type
module:eclairjs/mllib/feature.HashingTF

copy(extra) → {module:eclairjs/mllib/feature.HashingTF}

Parameters:
Name Type Description
extra module:eclairjs/ml/param.ParamMap
Overrides:
Source:
Returns:
Type
module:eclairjs/mllib/feature.HashingTF

getNumFeatures() → {number}

Source:
Returns:
Type
number

numFeatures() → {module:eclairjs/ml/param.Param}

Source:
Returns:
Type
module:eclairjs/ml/param.Param

setBinary(value) → {module:eclairjs/mllib/feature.HashingTF}

Parameters:
Name Type Description
value boolean
Source:
Returns:
Type
module:eclairjs/mllib/feature.HashingTF

setInputCol(value) → {module:eclairjs/mllib/feature.HashingTF}

Parameters:
Name Type Description
value string
Source:
Returns:
Type
module:eclairjs/mllib/feature.HashingTF

setNumFeatures(value) → {module:eclairjs/mllib/feature.HashingTF}

Parameters:
Name Type Description
value number
Source:
Returns:
Type
module:eclairjs/mllib/feature.HashingTF

setOutputCol(value) → {module:eclairjs/mllib/feature.HashingTF}

Parameters:
Name Type Description
value string
Source:
Returns:
Type
module:eclairjs/mllib/feature.HashingTF

transform(dataset) → {module:eclairjs/sql.Dataset}

Parameters:
Name Type Description
dataset module:eclairjs/sql.Dataset
Overrides:
Source:
Returns:
Type
module:eclairjs/sql.Dataset

transformSchema(schema) → {module:eclairjs/sql/types.StructType}

Parameters:
Name Type Description
schema module:eclairjs/sql/types.StructType
Overrides:
Source:
Returns:
Type
module:eclairjs/sql/types.StructType

uid() → {string}

An immutable unique ID for the object and its derivatives.
Source:
Returns:
Type
string