river icon indicating copy to clipboard operation
river copied to clipboard

DBSTREAM: add "time" argument to the learn function

Open ShkarupaDC opened this issue 6 months ago • 2 comments

Hi! I want to propose a new feature for DBSTREAM.

DBSTREAM uses a protected internal timer (_time_stamp) to measure the time between learning steps. There are 2 issues with this approach.

  1. First, when several learning samples arrive at a time instead of one, we should update the internal timer manually like that
for x in batch:
    dbstream.learn_one(x)
    dbstream._time_stamp -= 1
dbstream._time_stamp += 1
  1. Second, using the natural time when samples arrive instead of a surrogate time is required sometimes. DBSTREAM does not distinguish 2 scenarios when samples come at
  • 100ms and 200ms
  • 100ms and 500ms if these arrivals are sequential (no other samples arrive in between). However, there can be a large difference from the business perspective.

I propose to add a t (time) argument to the learn_one function. Then, we can learn from samples using the same t value if samples arrive simultaneously and supply time in any units to this function, adjusting the fading_factor.

ShkarupaDC avatar Dec 09 '23 11:12 ShkarupaDC