[DOCS] Adds feature importance mapping subsection to inference processor docs (#54190)
This commit is contained in:
parent
1afd510721
commit
487b273286
|
@ -34,7 +34,6 @@ include::common-options.asciidoc[]
|
||||||
// NOTCONSOLE
|
// NOTCONSOLE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[discrete]
|
[discrete]
|
||||||
[[inference-processor-regression-opt]]
|
[[inference-processor-regression-opt]]
|
||||||
==== {regression-cap} configuration options
|
==== {regression-cap} configuration options
|
||||||
|
@ -51,6 +50,7 @@ Specifies the maximum number of
|
||||||
importance] values per document. By default, it is zero and no feature importance
|
importance] values per document. By default, it is zero and no feature importance
|
||||||
calculation occurs.
|
calculation occurs.
|
||||||
|
|
||||||
|
|
||||||
[discrete]
|
[discrete]
|
||||||
[[inference-processor-classification-opt]]
|
[[inference-processor-classification-opt]]
|
||||||
==== {classification-cap} configuration options
|
==== {classification-cap} configuration options
|
||||||
|
@ -73,8 +73,9 @@ Specifies the field to which the top classes are written. Defaults to
|
||||||
(Optional, integer)
|
(Optional, integer)
|
||||||
Specifies the maximum number of
|
Specifies the maximum number of
|
||||||
{ml-docs}/dfa-classification.html#dfa-classification-feature-importance[feature
|
{ml-docs}/dfa-classification.html#dfa-classification-feature-importance[feature
|
||||||
importance] values per document. By default, it is zero and no feature importance
|
importance] values per document. By default, it is zero and no feature
|
||||||
calculation occurs.
|
importance calculation occurs.
|
||||||
|
|
||||||
|
|
||||||
[discrete]
|
[discrete]
|
||||||
[[inference-processor-config-example]]
|
[[inference-processor-config-example]]
|
||||||
|
@ -116,3 +117,65 @@ categories for which the predicted probabilities are reported is 2
|
||||||
(`num_top_classes`). The result is written to the `prediction` field and the top
|
(`num_top_classes`). The result is written to the `prediction` field and the top
|
||||||
classes to the `probabilities` field. Both fields are contained in the
|
classes to the `probabilities` field. Both fields are contained in the
|
||||||
`target_field` results object.
|
`target_field` results object.
|
||||||
|
|
||||||
|
|
||||||
|
[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}/dfa-classification.html#dfa-classification-feature-importance[{feat-imp}].
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
"ml.inference.feature_importance": {
|
||||||
|
"type": "nested",
|
||||||
|
"dynamic": true,
|
||||||
|
"properties": {
|
||||||
|
"feature_name": {
|
||||||
|
"type": "keyword"
|
||||||
|
},
|
||||||
|
"importance": {
|
||||||
|
"type": "double"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--------------------------------------------------
|
||||||
|
// NOTCONSOLE
|
||||||
|
|
||||||
|
The mapping field name for {feat-imp} 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`.
|
||||||
|
|
||||||
|
For example, you provide a tag `foo` in the definition as you can see below:
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
{
|
||||||
|
"tag": "foo",
|
||||||
|
...
|
||||||
|
}
|
||||||
|
--------------------------------------------------
|
||||||
|
// NOTCONSOLE
|
||||||
|
|
||||||
|
|
||||||
|
The `{feat-imp}` value is written to the `ml.inference.foo.feature_importance`
|
||||||
|
field.
|
||||||
|
|
||||||
|
You can also specify a target field as follows:
|
||||||
|
|
||||||
|
[source,js]
|
||||||
|
--------------------------------------------------
|
||||||
|
{
|
||||||
|
"tag": "foo",
|
||||||
|
"target_field": "my_field"
|
||||||
|
}
|
||||||
|
--------------------------------------------------
|
||||||
|
// NOTCONSOLE
|
||||||
|
|
||||||
|
In this case, `{feat-imp}` is exposed in the
|
||||||
|
`my_field.foo.feature_importance` field.
|
Loading…
Reference in New Issue