Operator

class nvtabular.ops.operator.Operator[source]

Bases: object

Base class for all operator classes.

transform(col_selector: nvtabular.columns.selector.ColumnSelector, df: pandas.core.frame.DataFrame)pandas.core.frame.DataFrame[source]

Transform the dataframe by applying this operator to the set of input columns

Parameters
  • columns (list of str or list of list of str) – The columns to apply this operator to

  • df (Dataframe) – A pandas or cudf dataframe that this operator will work on

Returns

Returns a transformed dataframe for this operator

Return type

DataFrame

compute_output_schema(input_schema: nvtabular.columns.schema.Schema, col_selector: nvtabular.columns.selector.ColumnSelector)nvtabular.columns.schema.Schema[source]

Given a set of schemas and a column selector for the input columns, returns a set of schemas for the transformed columns this operator will produce :param input_schema: The schemas of the columns to apply this operator to :type input_schema: Schema :param col_selector: The column selector to apply to the input schema :type col_selector: ColumnSelector

Returns

The schemas of the columns produced by this operator

Return type

Schema

transformed_schema(column_schema)[source]
output_dtype()[source]

Retrieves a dictionary of format; column_name: column_dtype. For all input(with output_names) and created columns

output_tags()[source]

Retrieves

output_properties()[source]
output_column_names(col_selector: nvtabular.columns.selector.ColumnSelector)nvtabular.columns.selector.ColumnSelector[source]

Given a set of columns names returns the names of the transformed columns this operator will produce

Parameters

columns (list of str, or list of list of str) – The columns to apply this operator to

Returns

The names of columns produced by this operator

Return type

list of str, or list of list of str

dependencies()Optional[List[Union[str, Any]]][source]

Defines an optional list of column dependencies for this operator. This lets you consume columns that aren’t part of the main transformation workflow.

Returns

Extra dependencies of this operator. Defaults to None

Return type

str, list of str or ColumnSelector, optional

property label
property supports

Returns what kind of data representation this operator supports

inference_initialize(col_selector: nvtabular.columns.selector.ColumnSelector, model_config: dict)Optional[nvtabular.ops.operator.Operator][source]

Configures this operator for use in inference. May return a different operator to use instead of the one configured for use during training