Inference Bucket Aggregationedit

A parent pipeline aggregation which loads a pre-trained model and performs inference on the collated result fields from the parent bucket aggregation.

To use the inference bucket aggregation, you need to have the same security privileges that are required for using the Get inference trained model.

Syntaxedit

A inference aggregation looks like this in isolation:

{
  "inference": {
    "model_id": "a_model_for_inference", 
    "inference_config": { 
      "regression_config": {
        "num_top_feature_importance_values": 2
      }
    },
    "buckets_path": {
      "avg_cost": "avg_agg", 
          "max_cost": "max_agg"
    }
  }
}

The ID of model to use.

The optional inference config which overrides the model’s default settings

Map the value of avg_agg to the model’s input field avg_cost

Table 33. inference Parameters

Parameter Name Description Required Default Value

model_id

The ID of the model to load and infer against

Required

-

inference_config

Contains the inference type and its options. There are two types: regression and classification

Optional

-

buckets_path

Defines the paths to the input aggregations and maps the aggregation names to the field names expected by the model. See buckets_path Syntax for more details

Required

-

Configuration options for inference modelsedit

The inference_config setting is optional and usually isn’t required as the pre-trained models come equipped with sensible defaults. In the context of aggregations some options can overridden for each of the 2 types of model.

Configuration options for regression modelsedit
num_top_feature_importance_values
(Optional, integer) Specifies the maximum number of feature importance values per document. By default, it is zero and no feature importance calculation occurs.
Configuration options for classification modelsedit
num_top_classes
(Optional, integer) Specifies the number of top class predictions to return. Defaults to 0.
num_top_feature_importance_values
(Optional, integer) Specifies the maximum number of feature importance values per document. By default, it is zero and no feature importance calculation occurs.
prediction_field_type
(Optional, string) Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.