HashingTF

Maps a sequence of terms to term frequencies using the hashing trick.

This operation is ported from Spark ML.

For a comprehensive introduction, see Spark documentation.

For scala docs details, see org.apache.spark.ml.feature.HashingTF documentation.

Since: Seahorse 1.0.0

Input

Port Type Qualifier Description
0DataFrameThe input DataFrame.

Output

Port Type Qualifier Description
0DataFrameThe output DataFrame.
1TransformerA Transformer that allows to apply the operation on other DataFrames using a Transform.

Parameters

Name Type Description
num features Numeric The number of features.
operate on InputOutputColumnSelector The input and output columns for the operation.

Example

Parameters

Name Value
num features 5.0
operate on one column
input column "signal"
output append new column
output column "hash"

Input

signal
[a,a,b,b,c,d]

Output

signal hash
[a,a,b,b,c,d] (5,[0,1,2,4],[2.0,2.0,1.0,1.0])