API Reference

next_n_days

monad.ui.target_function.next_n_days

monad.ui.target_function.next_n_days(events, start, n)

To restrict the events to a desired number of days.

from monad.ui.target_function import next_n_days

def target_fn(_history: Events, future: Events, _entity: Attributes, _ctx: Dict) -> np.ndarray:
  target_window_days = 21     
  future_constrained = next_n_days(events=future, start=_ctx[SPLIT_TIMESTAMP], n=target_window_days)
  ...
Parameters

events : Events
Events to filter.


start : float
Default: None
The timestamp indicating the starting point for events to be considered after applying the filter.


n: int | None
Default: None
Number of days to include, or None to return all events after start timestamp.

Returns

Events restricted to the chosen time range.