|
1 | 1 | #4-4. Frame - Encoding |
2 | 2 |
|
| 3 | +<figure><imgsrc="../../.gitbook/assets/image (216).png"alt=""width="499"><figcaption></figcaption></figure> |
3 | 4 |
|
| 5 | +* This feature is used for columns with categorical data entered. |
4 | 6 |
|
5 | | -<figure><imgsrc="../../.gitbook/assets/image (38).png"alt=""><figcaption></figcaption></figure> |
6 | | - |
7 | | -Use this feature for columns where categorical data is entered. |
8 | | - |
9 | | -1._**Label Encoding**_: Assign a number for each type of variable.  |
10 | | - |
11 | | -  For example, assign 0 for spring, 1 for summer, 2 for autumn, and 3 for winter. |
12 | | - |
13 | | -2._**One-Hot-Encoding**_: Assign a binary vector for each type of variable.  |
14 | | - |
15 | | -  For example, spring is assigned\[1, 0, 0, 0], summer is\[0, 1, 0, 0], autumn is\[0, 0, 1, 0],  |
16 | | - |
17 | | -  and winter is\[0, 0, 0, 1]. |
| 7 | +1._**Label Encoding**_: Assign a number to each type of variable.  |
| 8 | +1. For example, assign 0 for spring, 1 for summer, 2 for fall, and 3 for winter. |
| 9 | +2._**One-Hot-Encoding**_: Assign a binary vector to each type of variable.  |
| 10 | +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]. |
18 | 11 |
|