One-hot encoding converts categorical values into binary indicator columns so numeric machine-learning models can process them through matrix operations. For a medicine’s Salt_Name, the matching category column is active while the others remain inactive. section 4.5.4
Use the technique with an explicit cardinality safeguard:
- Group distinct category values before encoding. section 4.5.4
- Keep the top 50 categories and collate the remainder into Other_Salt. section 4.5.4
- Create one column for each retained category plus the other group. section 4.5.4
- Treat the cap as a trade-off: more categories may improve accuracy but increase columns and training cost. section 4.5.4
Salt_Name
A Paracetamol value becomes active in Salt_Name_Grouped_Paracetamol; an Ibuprofen value activates Salt_Name_Grouped_Ibuprofen; values outside the top 50 activate Salt_Name_Grouped_Other_Salt. section 4.5.4
Figure 4.7 One-hot encoding of the Salt_Name column value.

Inspect the figure showing the one-hot transformation of a Salt_Name value. section 4.5.4









