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.

Usage


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.

Inputs


labels: column:category

A categorical column.

Outputs


label_codes: column:number

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

Back to top