# Encoding distance variable that is continuous until out-of-range

I have a varaible distance which is continous until a "hard stop" at which we stop measuring the distance itself and just label the distance as "out of range". Example:

distances: 10.1, 11.3, 20.2, 36.5, 39.6, out_of_range, out_of_range


Is there a best practise approach for encoding this data that is continous until a point? I have thought about just setting: out_of_range = max(distances) so that all out_of_range data is set at the same value but I'm not sure if this could have implications with an ML model assuming that an example with a longer distance that is in-range is close to an example that is out-of-range.

This out_of_range data is useful so I don't want to just remove it from the model but I would like to be able to differentate within the model between examples that are in_range vs out_of_range.

For context I'm planning on using this data as in input into a tree-based ML model such as Random Forrest