# What's the optimal way to encode a 'month' feature?

What's the optimal way to encode a 'month' feature? A single integer value or 12 binary values don't quite grasp the concept of modulo distance...

Say I want to train an SVM for a certain task and believe that the time of the year might contribute some valuable information, how should I transform it into a feature? What's the general approach to encoding numerical values that sit on a ring rather than an axis when using linear classifiers?

• Perhaps 12 binary variables, one for each month. Commented Jul 23, 2014 at 7:46
• What is optimal depends on your model. Please clarify what you need it to do. Commented Jul 23, 2014 at 10:49
• Can you clarify what the "certain task" is that you want the SVM to do? Commented Jul 23, 2014 at 20:03
• It doesn't really matter, but if you insist, it's predicting the rating changes in some TV shows. Commented Jul 24, 2014 at 7:49
• Embed on circle in R^2? angle = (month-1) * pi / 6 where month: January=1, February=2, ... enc = (cos(angle), sin(angle)) Commented May 17, 2022 at 14:35