At work I often have a variable encoding where you count the number of each category with respect to a key. (Which makes sense for the domain I am in) Does this process have a machine learning or statistical name?
Recently, I realized from Encoding Categorical Features that is not exactly "one-hot encoding". For example, given this data:
+----+----------+-----+
| id | category | y |
+----+----------+-----+
| 1 | A | 40 |
+----+----------+-----+
| 1 | B | 40 |
+----+----------+-----+
| 1 | C | 40 |
+----+----------+-----+
| 2 | B | 50 |
+----+----------+-----+
| 3 | A | 100 |
+----+----------+-----+
| 3 | A | 100 |
+----+----------+-----+
| 3 | C | 100 |
+----+----------+-----+
I normally get this:
+----+---+---+---+----+
| id | A | B | C | y |
+----+---+---+---+----+
| 1 | 1 | 1 | 1 | 40 |
+----+---+---+---+----+
| 2 | 0 | 1 | 0 | 50 |
+----+---+---+---+----+
| 3 | 2 | 0 | 1 |100 |
+----+---+---+---+----+
Which makes sense because a repeated category in this particular database is a measure severity and intensity. However, one-hotting is apparently this:
+----+---+---+---+----+
| id | A | B | C | y |
+----+---+---+---+----+
| 1 | 1 | 1 | 1 | 40 |
+----+---+---+---+----+
| 2 | 0 | 1 | 0 | 50 |
+----+---+---+---+----+
| 3 | 1 | 0 | 1 |100 |
+----+---+---+---+----+
My question is this a common procedure and if so what is its name?