Data Preparation for ML and AI
An engineer uses hour of day, recorded as integers from 0 to 23, in a distance-based model. Which transformation BEST preserves the proximity of hours across midnight while keeping all hours distinguishable?
Show the answer
Correct answerC. Encode the hour as sine and cosine coordinates on a daily cycle.
AWhy not this: Min-max scaling retains the endpoints of a line rather than connecting the hours across midnight.
BWhy not this: Standardization changes the scale but retains the artificial distance between hours across midnight.
CWhy this is right: Paired sine and cosine coordinates preserve cyclic proximity and distinguish each hour of the daily cycle.
DWhy not this: Broad time-of-day indicators merge distinct hours, losing the required hourly distinctions.
Sine and cosine encoding places hours on a circle, keeping hours across midnight close while distinguishing all hours. Min-max scaling preserves a linear ordering, so midnight and 23:00 remain far apart.