morpheus.utils.nvt.mutate.MutateOp
- class MutateOp(*args, **kwargs)[source]
Bases:
nvtabular.ops.operator.Operator
- Attributes
label
Get the label of the MutateOp instance.
Methods
__call__
(*args, **kwargs)Call self as a function. column_mapping
(col_selector)Generate a column mapping. compute_output_schema
(input_schema, col_selector)Compute the output schema. transform
(col_selector, df)Apply the transformation function on the dataframe. - column_mapping(col_selector)[source]
Generate a column mapping.
- Parameters
- col_selector
Instance of ColumnSelector.
- Returns
- Dict[str, str]
Dictionary of column mappings.
- compute_output_schema(input_schema, col_selector, prev_output_schema=None)[source]
Compute the output schema.
- Parameters
- input_schema
- col_selector
- prev_output_schema
The input schema.
Instance of ColumnSelector.
Previous output schema, by default None.
- Returns
- Schema
The output schema.
- property label
Get the label of the MutateOp instance.
- Returns
- str
The label of the MutateOp instance.
- transform(col_selector, df)[source]
Apply the transformation function on the dataframe.
- Parameters
- col_selector
- df
Instance of ColumnSelector.
Input dataframe.
- Returns
- DataFrameType
Transformed dataframe.