Evaluate data frame analytics
- POST /_ml/data_frame/_evaluate
The API packages together commonly used evaluation metrics for various types of machine learning features. This has been designed for use on indexes created by data frame analytics. Evaluation requires both a ground truth field and an analytics result field to be present.
Required authorization
- Cluster privileges monitor_ml
Request body
-
evaluationobjectrequired -
Defines the type of evaluation you want to perform.
-
classificationobject -
Classification evaluation evaluates the results of a classification analysis which outputs a prediction that identifies to which of the classes each document belongs.
-
actual_fieldstringrequired -
The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true).
-
predicted_fieldstring -
The field in the index which contains the predicted value, in other words the results of the classification analysis.
-
top_classes_fieldstring -
The field of the index which is an array of documents of the form { "class_name": XXX, "class_probability": YYY }. This field must be defined as nested in the mappings.
-
outlier_detectionobject -
Outlier detection evaluates the results of an outlier detection analysis which outputs the probability that each document is an outlier.
-
actual_fieldstringrequired -
The field of the index which contains the ground truth. The data type of this field can be boolean or integer. If the data type is integer, the value has to be either 0 (false) or 1 (true).
-
predicted_probability_fieldstringrequired -
The field of the index that defines the probability of whether the item belongs to the class in question or not. It’s the field that contains the results of the analysis.
-
regressionobject -
Regression evaluation evaluates the results of a regression analysis which outputs a prediction of values.
-
actual_fieldstringrequired -
The field of the index which contains the ground truth. The data type of this field must be numerical.
-
predicted_fieldstringrequired -
The field in the index that contains the predicted value, in other words the results of the regression analysis.
-
metricsobject -
Specifies the metrics that are used for the evaluation. For more information on mse, msle, and huber, consult the Jupyter notebook on regression loss functions.
-
msemap string to object -
Average squared difference between the predicted values and the actual (ground truth) value. For more information, read this wiki article.
-
msleobject -
Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value.
-
queryQuery -
A query clause that retrieves a subset of data from the source index.
Response
-
classificationobject -
Evaluation results for a classification analysis. It outputs a prediction that identifies to which of the classes each document belongs.
-
outlier_detectionobject -
Evaluation results for an outlier detection analysis. It outputs the probability that each document is an outlier.
-
auc_rocobject · default: {"include_curve": false} -
The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve.
-
precisionmap string to number -
Set the different thresholds of the outlier score at where the metric is calculated.
-
recallmap string to number -
Set the different thresholds of the outlier score at where the metric is calculated.