Skip to content

Commit

Permalink
[DOCS] Improves inference processor linking and docs (#66119)
Browse files Browse the repository at this point in the history
  • Loading branch information
szabosteve authored Jan 5, 2021
1 parent 5e74f79 commit d3ad9fe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
32 changes: 20 additions & 12 deletions docs/reference/ingest/processors/inference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification

[source,js]
--------------------------------------------------
{
"inference":{
"model_id":"my_model_id"
"inference_config": {
"regression": {
"results_field": "my_regression"
Expand All @@ -105,7 +106,8 @@ object.

[source,js]
--------------------------------------------------
{
"inference":{
"model_id":"my_model_id"
"inference_config": {
"classification": {
"num_top_classes": 2,
Expand All @@ -123,14 +125,18 @@ categories for which the predicted probabilities are reported is 2
classes to the `probabilities` field. Both fields are contained in the
`target_field` results object.

Refer to the
{ml-docs}/ml-lang-ident.html#ml-lang-ident-example[language identification]
trained model documentation for a full example.


[discrete]
[[inference-processor-feature-importance]]
==== {feat-imp-cap} object mapping

Update your index mapping of the {feat-imp} result field as you can see below to
get the full benefit of aggregating and searching for
{ml-docs}/ml-feature-importance.html[{feat-imp}].
To get the full benefit of aggregating and searching for
{ml-docs}/ml-feature-importance.html[{feat-imp}], update your index mapping of
the {feat-imp} result field as you can see below:

[source,js]
--------------------------------------------------
Expand All @@ -149,14 +155,16 @@ get the full benefit of aggregating and searching for
--------------------------------------------------
// NOTCONSOLE

The mapping field name for {feat-imp} is compounded as follows:
The mapping field name for {feat-imp} (in the example above, it is
`ml.inference.feature_importance`) is compounded as follows:

`<ml.inference.target_field>`.`<inference.tag>`.`feature_importance`

If `inference.tag` is not provided in the processor definition, it is not part
of the field path. The `<ml.inference.target_field>` defaults to `ml.inference`.
* `<ml.inference.target_field>`: defaults to `ml.inference`.
* `<inference.tag>`: if is not provided in the processor definition, then it is
not part of the field path.

For example, you provide a tag `foo` in the definition as you can see below:
For example, if you provide a tag `foo` in the definition as you can see below:

[source,js]
--------------------------------------------------
Expand All @@ -168,10 +176,10 @@ For example, you provide a tag `foo` in the definition as you can see below:
// NOTCONSOLE


The {feat-imp} value is written to the `ml.inference.foo.feature_importance`
field.
Then, the {feat-imp} value is written to the
`ml.inference.foo.feature_importance` field.

You can also specify a target field as follows:
You can also specify the target field as follows:

[source,js]
--------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@ You can use the following APIs to perform {infer} operations.
* <<get-trained-models-stats>>
* <<delete-trained-models>>

You can deploy a trained model to make predictions in an ingest pipeline or in
an aggregation. Refer to the following documentation to learn more.

* <<inference-processor,{infer-cap} processor>>
* <<search-aggregations-pipeline-inference-bucket-aggregation,{infer-cap} bucket aggregation>>


See also <<ml-apis>>.

0 comments on commit d3ad9fe

Please sign in to comment.