polars_online.FormulaTarget¶
- class polars_online.FormulaTarget[source]¶
Bases:
TypedDictA 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 withnameandformulain the command line’s TOML.nameis the expression’s alias, which the output fields carry.formulais 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