quantlab.model.library_model.Rows#

class quantlab.model.library_model.Rows(x, y, y_raw, where)[source]#

Bases: NamedTuple

The training or validation rows of one fit.

Rows are ordered by bar, then by symbol.

Attributes:
xnp.ndarray

Features after _transform_feature, [n, F] float32. NaN is kept for the library’s own missing-value handling.

ynp.ndarray

Training target, [n, L] float32, finite everywhere: the output of the head’s _transform_target on the row’s bar.

y_rawnp.ndarray

Raw labels, [n, L] float32.

wheretuple[np.ndarray, np.ndarray]

Timestamp and symbol index of each row in the collected panel, two [n] int64 arrays.

Examples

>>> rows = Rows(
...     x=np.zeros((2, 3), dtype=np.float32), y=np.zeros((2, 1), dtype=np.float32),
...     y_raw=np.zeros((2, 1), dtype=np.float32),
...     where=(np.array([0, 0]), np.array([0, 1])),
... )
>>> len(rows.x), rows.where[1].tolist()
(2, [0, 1])
where#

Alias for field number 3

x#

Alias for field number 0

y#

Alias for field number 1

y_raw#

Alias for field number 2