Skip to content

Label encode

data types

Encode categories with values between 0 and N-1, where N is the number of unique categories.

In other words, the first category will be assigned the number 0 and the last category a value of N-1.


The following are the step's expected inputs and outputs and their specific types.

Step signature
label_encode(labels: category) -> (label_codes: number)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.


labels: column:category

A categorical column.


label_codes: column:number

A numeric column where labels have been replaced with values between 0 and N-1.