How to feed a 360° orientation variable into a neural network

A predictor (X) variable could be an orientation variable on a 360° scale.

Obviously, it is a continuum, the value 360 being very close to 1. Inputing a continuous variable from 1 to 360 into the neural network would thus introduce bias.

What would be the best way to handle this ?

  • One way could be to categorizing the values (1 to 360) into categories: North - NorthEast - East - EastSouth - South - SouthWest - West - WestNorth.

Any other suggestions or comments?

Using categorical inputs i.e. transform the degree as such inputs to the model. Those can be ordinal encoding , one hot encoding, embedding encoding etc. If the number of categories is not large, as a rule less or around 20 can use one hot encoding.

1 Like

Thank you very much @gent.spah

You gave me a very good input, I didn’t think about embedding. Following your input, I did some research and found this : 3 Ways to Encode Categorical Variables for Deep Learning

They did not find any significant differences between integer encoding, one hot encoding and learned embeding. But in our case, for orientation (360 degrees) learned embedding might be the best way to go and might produce far better results than integer or one hot encoding. I will test the 3 techniques and respond to this post with the results later on.

2 Likes