polars_online.FormulaTarget

class polars_online.FormulaTarget[source]

Bases: TypedDict

A formula target, written as a table.

It is what an expression over the window operators that looks ahead becomes in a spec’s targets, and a [[specs]] target table with name and formula in the command line’s TOML. name is the expression’s alias, which the output fields carry. formula is the expression’s compact tree (polars_online.ops), holding at least one window operator that looks ahead (reverse=True).

Examples

ahead = po.ewm_mean("y", half_life=5.0, window_size=10.0, reverse=True).alias("y_ahead")
spec = po.spec.ewridge("m", targets=[ahead], features=["x0"], half_life=50.0)
print(list(spec["targets"][0]), spec["targets"][0]["name"])   # a FormulaTarget
['name', 'formula'] y_ahead