screamer.js
    Preparing search index...

    Function forecastPairs

    • Pair features with the target over a horizon after them.

      Returns [X_paired, y_paired], a training set for a model that predicts the target from the features. y is a causal series: its value at step t is known at t, so a target over a horizon h is stamped at the end of that horizon (for example LogReturn(h) of a price at t is the return over (t - h, t]). The horizon is exactly one of count (a number of events) and duration (index units, see delay).

      index chooses whose index a row carries:

      • "features" (the default): row t holds X[t] and the target over (t, t + h]. This is the row a live model sees, with the target filled in. The last rows, whose target is not known yet, have a NaN target. In count mode the target is y[t + count]. In duration mode there is one row per X event, holding the last y at or before t + duration, NaN when y ends before it.
      • "target": row t holds X[t - h] and y[t], stamped when the target is known. In count mode the first count feature rows are NaN. In duration mode there is one row per y event, holding the last X at or before t - duration.

      In count mode both settings hold the same pairs; with dropna: true, which drops every row that holds a NaN, they return identical arrays.

      • Count mode: X is a 1-D array, a [T, K] NdArray or T rows, and y one column of the same length.
      • Duration mode: X and y are { values, index } streams.
      • With Input nodes, returns a Node whose output row is [X..., y], for a Pipeline (and its live sessions). X may have any width.

      In a live session with index: "features", the row for t is emitted once its target is known (count later events have arrived, or y has passed t + duration), still stamped t, so stamps stay in order. flush() emits the rows still waiting with a NaN target.

      Returns [X_paired, y_paired]: X_paired has X's rank (a Float64Array, or an NdArray of shape [rows, K]). Python's forecast_pairs gives the same values.

      Parameters

      Returns Node

    • Pair features with the target over a horizon after them.

      Returns [X_paired, y_paired], a training set for a model that predicts the target from the features. y is a causal series: its value at step t is known at t, so a target over a horizon h is stamped at the end of that horizon (for example LogReturn(h) of a price at t is the return over (t - h, t]). The horizon is exactly one of count (a number of events) and duration (index units, see delay).

      index chooses whose index a row carries:

      • "features" (the default): row t holds X[t] and the target over (t, t + h]. This is the row a live model sees, with the target filled in. The last rows, whose target is not known yet, have a NaN target. In count mode the target is y[t + count]. In duration mode there is one row per X event, holding the last y at or before t + duration, NaN when y ends before it.
      • "target": row t holds X[t - h] and y[t], stamped when the target is known. In count mode the first count feature rows are NaN. In duration mode there is one row per y event, holding the last X at or before t - duration.

      In count mode both settings hold the same pairs; with dropna: true, which drops every row that holds a NaN, they return identical arrays.

      • Count mode: X is a 1-D array, a [T, K] NdArray or T rows, and y one column of the same length.
      • Duration mode: X and y are { values, index } streams.
      • With Input nodes, returns a Node whose output row is [X..., y], for a Pipeline (and its live sessions). X may have any width.

      In a live session with index: "features", the row for t is emitted once its target is known (count later events have arrived, or y has passed t + duration), still stamped t, so stamps stay in order. flush() emits the rows still waiting with a NaN target.

      Returns [X_paired, y_paired]: X_paired has X's rank (a Float64Array, or an NdArray of shape [rows, K]). Python's forecast_pairs gives the same values.

      Returns [Float64Array<ArrayBufferLike> | NdArray, Float64Array<ArrayBufferLike>]