+ 5
Encoding features in ML task
I'm building a model to learn how to play card game. I'm wondering the best encoding to apply. For example how to encode each card's name such that if name ace of spades as 8, it shouldn't mean it's closer to card named 9 than the one named 1. I've read about different encoding techniques like onehot, leaveoutone etc but I just can't understand the one best suited for my needs.
4 ответов
+ 6
The "best" encoding method depends on how the game is played. In ML, oftentimes 8 doesn't necessarily mean it is closer to 9 than it is to 1. That is also dependent on how the encoding result is interpreted.
That said, for the typical card game, cards can be encoded as a vector of characteristics. To avoid from the semantics of distance implied by numbers, you can differentiate them based on:
isSpade, isDiamond, isClub, isHeart, value
which is a variation of one-hot encoding, but without a boolean aspect to the last characteristic (since value is indeed relative).
E.g.
Ace of Spades [1, 0, 0, 0, 1]
King of Diamonds [0, 1, 0, 0, 13]
As such, each card is distinct and the "distance" between two vectors actually makes sense.
+ 2
Great Hatsy Rei ...this gonna work.👍👍👍. This is more than what I was expecting.
0
..ььлгеениреу