merlin.systems.dag.ops.tensorflow.PredictTensorflow#

class merlin.systems.dag.ops.tensorflow.PredictTensorflow(model_or_path, custom_objects: Optional[dict] = None)[source]#

Bases: Operator

TensorFlow Model Prediction Operator.

__init__(model_or_path, custom_objects: Optional[dict] = None)[source]#

Instantiate a PredictTensorflow inference operator.

Parameters:
  • model_or_path (Tensorflow model or string) – This can be a tensorflow model or a path to a tensorflow model.

  • custom_objects (dict, optional) – Any custom objects that need to be loaded with the model, by default None.

Methods

__init__(model_or_path[, custom_objects])

Instantiate a PredictTensorflow inference operator.

column_mapping(col_selector)

Compute which output columns depend on which input columns

compute_column_schema(col_name, input_schema)

compute_input_schema(root_schema, ...)

Use the input schema supplied during object creation.

compute_output_schema(input_schema, col_selector)

Use the output schema supplied during object creation.

compute_selector(input_schema, selector[, ...])

Provides a hook method for sub-classes to override to implement custom column selection logic.

create_node(selector)

export(path, input_schema, output_schema, ...)

Export the class object as a config and all related files to the user defined path.

from_path(path, **kwargs)

load_artifacts([artifact_path])

Load artifacts from disk required for operator function.

output_column_names(col_selector)

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

save_artifacts([artifact_path])

Save artifacts required to be reload operator state from disk

transform(col_selector, transformable)

Run model inference.

validate_schemas(parents_schema, ...[, ...])

Provides a hook method that sub-classes can override to implement schema validation logic.

Attributes

dependencies

Defines an optional list of column dependencies for this operator.

dynamic_dtypes

export_name

Provides a clear common english identifier for this operator.

is_subgraph

label

output_dtype

output_properties

output_tags

supported_formats

supports

Returns what kind of data representation this operator supports

transform(col_selector: ColumnSelector, transformable: Transformable) Transformable[source]#

Run model inference. Returning predictions.

Parameters:
  • col_selector (ColumnSelector) – Unused ColumunSelector input

  • transformable (Transformable) – Input features to model

Returns:

Model Predictions

Return type:

Transformable

classmethod from_path(path, **kwargs)[source]#
compute_input_schema(root_schema: Schema, parents_schema: Schema, deps_schema: Schema, selector: ColumnSelector) Schema[source]#

Use the input schema supplied during object creation.

compute_output_schema(input_schema: Schema, col_selector: ColumnSelector, prev_output_schema: Optional[Schema] = None) Schema[source]#

Use the output schema supplied during object creation.

property supported_formats: DataFormats#