How to treat Compass data in 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.