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.

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

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.