merlin.systems.dag.ops.implicit.PredictImplicit#
- class merlin.systems.dag.ops.implicit.PredictImplicit(model, num_to_recommend: int = 10, **kwargs)[source]#
Bases:
PipelineableInferenceOperator
Operator for running inference on Implicit models..
- __init__(model, num_to_recommend: int = 10, **kwargs)[source]#
Instantiate an Implicit prediction operator.
- Parameters:
model (An Implicit Model instance) –
num_to_recommend (int) – the number of items to return
Methods
__init__
(model[, num_to_recommend])Instantiate an Implicit prediction 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, ...)Return the input schema representing the input columns this operator expects to use.
compute_output_schema
(input_schema, col_selector)Return the output schema representing the columns this operator returns.
compute_selector
(input_schema, selector[, ...])Provides a hook method for sub-classes to override to implement custom column selection logic.
create_node
(selector)_summary_
export
(path, input_schema, output_schema[, ...])Export the class and related files to the path specified.
from_config
(config, **kwargs)Instantiate the class from a dictionary representation.
from_model_registry
(registry, **kwargs)Loads the InferenceOperator from the provided ModelRegistry.
from_path
(path, **kwargs)Loads the InferenceOperator from the path where it was exported after training.
load_artifacts
(artifact_path)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)Transform the dataframe by applying this operator to the set of input columns.
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
scalar_shape
supported_formats
supports
Returns what kind of data representation this operator supports
- compute_input_schema(root_schema: Schema, parents_schema: Schema, deps_schema: Schema, selector: ColumnSelector) Schema [source]#
Return the input schema representing the input columns this operator expects to use.
- compute_output_schema(input_schema: Schema, col_selector: ColumnSelector, prev_output_schema: Optional[Schema] = None) Schema [source]#
Return the output schema representing the columns this operator returns.
- property exportable_backends#
- export(path: str, input_schema: Schema, output_schema: Schema, params: Optional[dict] = None, node_id: Optional[int] = None, version: int = 1, backend: str = 'ensemble')[source]#
Export the class and related files to the path specified.
- classmethod from_config(config: dict, **kwargs) PredictImplicit [source]#
Instantiate the class from a dictionary representation.
Expected config structure: {
“input_dict”: str # JSON dict with input names and schemas “params”: str # JSON dict with params saved at export
}
- transform(col_selector: ColumnSelector, transformable: Transformable) Transformable [source]#
Transform the dataframe by applying this operator to the set of input columns.
- Parameters:
df (DictArray) – A pandas or cudf dataframe that this operator will work on
- Returns:
Returns a transformed dataframe for this operator
- Return type:
DictArray