How to treat Compass data in random forest regression I'm working on a project where two of the features are entryHeading and exitHeading. Both state the direction (N, NE, E, SE, S, SW, W) of a vehicle at multiple points. My question is how would i go about pre-processing this? My first thought would be to circularize it like I would a 24 hour period but I'm not sure I should go about it in the same way. The data will eventually be used to train a Random forest regression
One option is to map the ordinal categories to numerical degrees. This would allow the machine learning model to learn the relative relationships. The machine learning model might interpolate values which may or may not be useful.

One common mapping is:

n  -&gt;   0  
ne -&gt;  45  
e  -&gt;  90  
se -&gt; 135  
s  -&gt; 180  
sw -&gt; 215  
w  -&gt; 270  


The book "Statistical Analysis of Circular Data" by Fisher goes into greater detail about more options.