Skip to content

Model time features drop sub-second precision #148

Open

Description

@Vedaant-J

Problem

On an index with a sub-second clock (graph.snapshot(timestamp_unit="milliseconds"), #123), two events 300 ms apart are visible, ordered and windowed correctly, but the model still sees them at the same moment.

Cause

The encoders turn every timestamp into whole seconds before building features:

  • packages/kumo-core/src/kumo_core/encoders/tensor_frame_encoder.py:213 seed_time // NANOSECONDS_IN_SECONDS
  • packages/kumo-core/src/kumo_core/encoders/tensor_frame_encoder.py:223 time.view(-1, 1) // NANOSECONDS_IN_SECONDS
  • packages/kumo-core/src/kumo_core/encoders/tensor_mapper.py:777 unix // 10**9

So relative-time and timestamp features are identical for events within the same second.

Proposed fix

Keep the sub-second part when computing time features, for example by dividing as floats or carrying the remainder. On a seconds index every timestamp is a whole second, so the model's inputs stay exactly as today.

Acceptance

  • On a millisecond index, two events 300 ms apart get different time features.
  • On a seconds index, encoder outputs are bit-identical to today's.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions