4-4. Frame - Encoding

  • This feature is used for columns with categorical data entered.

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

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

  2. One-Hot-Encoding: Assign a binary vector to each type of variable.

    1. For example, spring would be assigned [1, 0, 0, 0], summer would be [0, 1, 0, 0], fall would be [0, 0, 1, 0], and winter would be [0, 0, 0, 1].

Last updated