Question about target value and one-hot encoding in classification analysis.

Asked 2 weeks ago, Updated 2 weeks ago, 1 views

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

2022-09-20 08:42

1 Answers

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.


2022-09-20 08:42

If you have any answers or tips


© 2022 pinfo. All rights reserved.