rheon.ColumnNotFoundError¶
- class rheon.ColumnNotFoundError[source]¶
Bases:
ValueErrorThe error raised when a column a call reads is not in its input.
For a column a spec reads, its message names the spec, the role the column plays (target, feature, clock, session, weight, group or label) and the column, and lists the input’s columns.
rp.stream.embargoandrp.stream.refresh_timeraise it too, for a column they name.rp.stream.with_windowsraises a plainValueErrorinstead.rp.evalraises it for a missinggroup,clockorweightcolumn, and for a target column whenspecis the spec dict; a plainValueErrorwhenspecis the spec’s name alone.It is a
ValueError, the class of every other value the bank refuses.rp.ColumnNotFoundError, the classrheon.polarsraises, is a subclass of this one and of Polars’ColumnNotFoundError, which Polars raises for a column a query names that its input does not have. Soexcept rheon.ColumnNotFoundError,except rp.ColumnNotFoundError, Polars’ class andValueErroreach catch what a call ofrheon.polarsraises.Examples
This code reads
dffrom Example data:spec = rp.spec.ewridge("ridge", targets=["y"], features=["x0", "x1"], half_life=100.0) bank = rp.ModelBank([spec]) try: bank.fit_predict(df.drop("x1")) except rheon.ColumnNotFoundError as e: # or rp.ColumnNotFoundError, or ValueError print(type(e).__name__, str(e).split(",")[0])
ColumnNotFoundError spec "ridge": feature column "x1" is not in the input
See also
OutputColumnNotFoundError, for a spec’s output column that a scoring function’s frame does not have.