A
by two and add column Col B
, you would simply write
"c = a + b"
. The correct way to return the result
as a column would simply be "a + b"
.
If the name of an input column contains spaces, such as in the example above, it should be quoted in
single backticks.
Usage
The following example shows how the step can be used in a recipe.Examples
Examples
Assuming a dataset
ds
containing the numeric columns num_a
, num_b
and num_c
, and a constant a
with value 1.3, the following formula transforms each column numerically before adding and multiplying them together, all in one step:Inputs & Outputs
The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name
), datasets (ds
or ds[["first_name", "last_name"]]
) or models (referenced
by name e.g. "churn-clf"
).
Inputs
Inputs
A dataset with columns to be used in the evaluation of the formula. Note, all columns mentioned in the formula must be numeric!
Outputs
Outputs
A numeric column containing the result of evaluating the formula.
Configuration
The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e.step(..., {"param": "value", ...}) -> (output)
.
Parameters
Parameters
The formula to execute.
A formula containing basic arithmetic operations and references to column names.
Constants to be used in the formula.
An object of key-value pairs, where keys refer to names of constants whose values will be available
in the formula with a
@
prefix. E.g. "constants": {"factor": 1.23}
makes it possible to refer to
@factor
in the formula with given value; also see example(s).Item properties
Item properties
One or more constants.
Note that all constant must be of allowed types (number or string).