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_selectorColumnSelector

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_schemaSchema

The input schema.

col_selectorColumnSelector

Instance of ColumnSelector.

prev_output_schemaOptional[Schema], optional

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_selectorColumnSelector

Instance of ColumnSelector.

dfDataFrameType

Input dataframe.

Returns:
DataFrameType

Transformed dataframe.

© Copyright 2023, NVIDIA. Last updated on Aug 23, 2023.