Hello.
Rating data with target values of 1, 2, 3, 4, and 5.
The purpose was to classify the target value according to the x value using the classification model, but the target value was
1,0,0,0,0
0,1,0,0,0
0,0,0,1,0
....
Giving with one hot encoding
1
2
4
5
...
Is there a difference from simply giving a target value of numbers?
python
If the target value is a rating, then there is an order relationship between the ratings. ( 1 < 2 < 3 < 4 < 5 )
Then it seems more reasonable not to do one-hot encoding.
If you do one-hot encoding, you do it when you can't line up the target. For example, if you're classifying apples, pears, oranges, if you say 1, 2, 3 each, you can predict apple-like, orange-like, but not pear-like, the average of 1 and 3. But it's nothing like a ship. At times like this, it's right to do one-hot encoding.
© 2024 OneMinuteCode. All rights reserved.