rheon.FormulaTarget

class rheon.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 (rheon.polars.ops), holding at least one window operator that looks ahead (reverse=True).

Examples

ahead = rp.ewm_mean("y", half_life=5.0, window_size=10.0, reverse=True).alias("y_ahead")
spec = rp.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