merlin.systems.dag.ops.fil.PredictForest#
- class merlin.systems.dag.ops.fil.PredictForest(model, input_schema, *, backend='python', **fil_params)[source]#
Bases:
Operator
Operator for running inference on Forest models.
This works for gradient-boosted decision trees (GBDTs) and Random forests (RF). While RF and GBDT algorithms differ in the way they train the models, they both produce a decision forest as their output.
Uses the Forest Inference Library (FIL) backend for inference.
- __init__(model, input_schema, *, backend='python', **fil_params)[source]#
Instantiate a FIL inference operator.
- Parameters:
model (Forest Model Instance) – A forest model class. Supports XGBoost, LightGBM, and Scikit-Learn.
input_schema (merlin.schema.Schema) – The schema representing the input columns expected by the model.
backend (str) – The Triton backend to use to when running this operator.
**fil_params – The parameters to pass to the FIL operator.
Methods
__init__
(model, input_schema, *[, backend])Instantiate a FIL 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, ...)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)export
(path, input_schema, output_schema, ...)Export the class object as a config and all related files to the user defined path.
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)Transform the dataframe by applying this FIL 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
supported_formats
supports
Returns what kind of data representation this operator supports
- 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.
- 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.
- transform(col_selector: ColumnSelector, transformable: Transformable) Transformable [source]#
Transform the dataframe by applying this FIL operator to the set of input columns.
- Parameters:
df (TensorTable) – A pandas or cudf dataframe that this operator will work on
- Returns:
Returns a transformed dataframe for this operator
- Return type:
TensorTable