4-4. Frame - Encoding

Use this feature for columns where categorical data is entered.

  1. Label Encoding: Assign a number for each type of variable.

For example, assign 0 for spring, 1 for summer, 2 for autumn, and 3 for winter.

  1. One-Hot-Encoding: Assign a binary vector for each type of variable.

For example, spring is assigned [1, 0, 0, 0], summer is [0, 1, 0, 0], autumn is [0, 0, 1, 0],

and winter is [0, 0, 0, 1].

Last updated