One Hot Encoder Advanced

Maps a column of label indices to a column of binary vectors, with at most a single one-value

Input

It takes in a DataFrame and transforms it to another DataFrame

Output

The output DataFrame contains a new column which contains the mapping of a column of label indices to a column of binary vectors, with at most a single one-value.

Type

ml-estimator

Class

fire.nodes.ml.NodeOneHotEncoderAdvanced

Fields

Name

Title

Description

inputCol

Input Column

Input column for encoding

outputCol

Output Column

Output column

Details

One Hot Encoder Advanced Node Details

The One Hot Encoder Advanced Node maps a column of label indices to a column of binary vectors, with at most a single one-value. It is an Estimator that takes in a DataFrame and transforms it to another DataFrame.

It takes in the common parameters inputCol and outputCol, which are the input and output column names. The input column should be of the type Integer, Long, Double or Float.

Input Parameters

INPUT COLUMN : Select the required column for which one-hot encoding has to be done.

OUTPUT COLUMN : The name of the output column after encoding.

Examples

One Hot Encoder Advanced Node Example

Consider the below One Hot Encoder Advanced output for the color column

id color encoded_color

0 Red [1.0, 0.0, 0.0]

1 Blue [0.0, 1.0, 0.0]

2 Green [0.0, 0.0, 1.0]

In this example, the input column is color and the output column is encoded_color. The One Hot Encoder Advanced maps the column color to a column of binary vectors, with at most a single one-value. Each unique category in the input column will be mapped to a binary vector of the same length as the number of unique categories in the input column.