Skip to content

Commit b4a6312

Browse files
authored
Add missing docs for new evaluation metrics (#50967) (#51041)
1 parent dd09dc7 commit b4a6312

File tree

1 file changed

+48
-31
lines changed

1 file changed

+48
-31
lines changed

docs/reference/ml/df-analytics/apis/evaluate-dfanalytics.asciidoc

+48-31
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,31 @@ result field to be present.
4242
==== {api-request-body-title}
4343

4444
`evaluation`::
45-
(Required, object) Defines the type of evaluation you want to perform. The
46-
value of this object can be different depending on the type of evaluation you
47-
want to perform. See <<ml-evaluate-dfanalytics-resources>>.
45+
(Required, object) Defines the type of evaluation you want to perform.
46+
See <<ml-evaluate-dfanalytics-resources>>.
4847
+
4948
--
5049
Available evaluation types:
50+
5151
* `binary_soft_classification`
5252
* `regression`
5353
* `classification`
54+
5455
--
5556

5657
`index`::
5758
(Required, object) Defines the `index` in which the evaluation will be
5859
performed.
5960

6061
`query`::
61-
(Optional, object) A query clause that retrieves a subset of data from the
62+
(Optional, object) A query clause that retrieves a subset of data from the
6263
source index. See <<query-dsl>>.
6364

6465
[[ml-evaluate-dfanalytics-resources]]
6566
==== {dfanalytics-cap} evaluation resources
6667

6768
[[binary-sc-resources]]
68-
===== Binary soft classification configuration objects
69+
===== Binary soft classification evaluation objects
6970

7071
Binary soft classification evaluates the results of an analysis which outputs
7172
the probability that each document belongs to a certain class. For example, in
@@ -86,24 +87,24 @@ document is an outlier.
8687
(Optional, object) Specifies the metrics that are used for the evaluation.
8788
Available metrics:
8889

89-
`auc_roc`::
90+
`auc_roc`:::
9091
(Optional, object) The AUC ROC (area under the curve of the receiver
9192
operating characteristic) score and optionally the curve. Default value is
9293
{"includes_curve": false}.
9394

94-
`precision`::
95+
`confusion_matrix`:::
96+
(Optional, object) Set the different thresholds of the {olscore} at where
97+
the metrics (`tp` - true positive, `fp` - false positive, `tn` - true
98+
negative, `fn` - false negative) are calculated. Default value is
99+
{"at": [0.25, 0.50, 0.75]}.
100+
101+
`precision`:::
95102
(Optional, object) Set the different thresholds of the {olscore} at where
96103
the metric is calculated. Default value is {"at": [0.25, 0.50, 0.75]}.
97104

98-
`recall`::
105+
`recall`:::
99106
(Optional, object) Set the different thresholds of the {olscore} at where
100107
the metric is calculated. Default value is {"at": [0.25, 0.50, 0.75]}.
101-
102-
`confusion_matrix`::
103-
(Optional, object) Set the different thresholds of the {olscore} at where
104-
the metrics (`tp` - true positive, `fp` - false positive, `tn` - true
105-
negative, `fn` - false negative) are calculated. Default value is
106-
{"at": [0.25, 0.50, 0.75]}.
107108

108109

109110
[[regression-evaluation-resources]]
@@ -121,9 +122,18 @@ which outputs a prediction of values.
121122
in other words the results of the {regression} analysis.
122123

123124
`metrics`::
124-
(Required, object) Specifies the metrics that are used for the evaluation.
125-
Available metrics are `r_squared` and `mean_squared_error`.
126-
125+
(Optional, object) Specifies the metrics that are used for the evaluation.
126+
Available metrics:
127+
128+
`mean_squared_error`:::
129+
(Optional, object) Average squared difference between the predicted values and the actual (`ground truth`) value.
130+
For more information, read https://en.wikipedia.org/wiki/Mean_squared_error[this wiki article].
131+
132+
`r_squared`:::
133+
(Optional, object) Proportion of the variance in the dependent variable that is predictable from the independent variables.
134+
For more information, read https://en.wikipedia.org/wiki/Coefficient_of_determination[this wiki article].
135+
136+
127137

128138
[[classification-evaluation-resources]]
129139
==== {classification-cap} evaluation objects
@@ -133,20 +143,28 @@ outputs a prediction that identifies to which of the classes each document
133143
belongs.
134144

135145
`actual_field`::
136-
(Required, string) The field of the `index` which contains the ground truth.
137-
The data type of this field must be keyword.
138-
139-
`metrics`::
140-
(Required, object) Specifies the metrics that are used for the evaluation.
141-
Available metric is `multiclass_confusion_matrix`.
146+
(Required, string) The field of the `index` which contains the `ground truth`.
147+
The data type of this field must be categorical.
142148

143149
`predicted_field`::
144150
(Required, string) The field in the `index` that contains the predicted value,
145-
in other words the results of the {classanalysis}. The data type of this field
146-
is string. You need to add `.keyword` to the predicted field name (the name
147-
you put in the {classanalysis} object as `prediction_field_name` or the
148-
default value of the same field if you didn't specified explicitly). For
149-
example, `predicted_field` : `ml.animal_class_prediction.keyword`.
151+
in other words the results of the {classanalysis}.
152+
153+
`metrics`::
154+
(Optional, object) Specifies the metrics that are used for the evaluation.
155+
Available metrics:
156+
157+
`accuracy`:::
158+
(Optional, object) Accuracy of predictions (per-class and overall).
159+
160+
`multiclass_confusion_matrix`:::
161+
(Optional, object) Multiclass confusion matrix.
162+
163+
`precision`:::
164+
(Optional, object) Precision of predictions (per-class and average).
165+
166+
`recall`:::
167+
(Optional, object) Recall of predictions (per-class and average).
150168

151169

152170
////
@@ -359,7 +377,7 @@ POST _ml/data_frame/_evaluate
359377
"evaluation": {
360378
"classification": { <1>
361379
"actual_field": "animal_class", <2>
362-
"predicted_field": "ml.animal_class_prediction.keyword", <3>
380+
"predicted_field": "ml.animal_class_prediction", <3>
363381
"metrics": {
364382
"multiclass_confusion_matrix" : {} <4>
365383
}
@@ -373,8 +391,7 @@ POST _ml/data_frame/_evaluate
373391
<2> The field that contains the ground truth value for the actual animal
374392
classification. This is required in order to evaluate results.
375393
<3> The field that contains the predicted value for animal classification by
376-
the {classanalysis}. Since the field storing predicted class is dynamically
377-
mapped as text and keyword, you need to add the `.keyword` suffix to the name.
394+
the {classanalysis}.
378395
<4> Specifies the metric for the evaluation.
379396

380397

0 commit comments

Comments
 (0)