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.
- Cluster privileges:
monitor_ml
Request
-
evaluationDataframeEvaluationContainerrequired -
Defines the type of evaluation you want to perform.
-
classificationDataframeEvaluationClassification -
Classification evaluation evaluates the results of a classification analysis which outputs a prediction that identifies to which of the classes each document belongs.
-
actual_fieldstring Fieldrequired -
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 Field -
The field in the index which contains the predicted value, in other words the results of the classification analysis.
-
top_classes_fieldstring Field -
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.
-
metricsDataframeEvaluationClassificationMetrics -
Specifies the metrics that are used for the evaluation.
-
auc_rocDataframeEvaluationClassificationMetricsAucRoc -
The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive.
-
class_namestring Name -
Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes.
-
include_curveboolean -
Whether or not the curve should be returned in addition to the score. Default value is false.
-
precisionmap string to object -
Precision of predictions (per-class and average).
-
recallmap string to object -
Recall of predictions (per-class and average).
-
accuracymap string to object -
Accuracy of predictions (per-class and overall).
-
multiclass_confusion_matrixmap string to object -
Multiclass confusion matrix.
-
outlier_detectionDataframeEvaluationOutlierDetection -
Outlier detection evaluates the results of an outlier detection analysis which outputs the probability that each document is an outlier.
-
actual_fieldstring Fieldrequired -
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_fieldstring Fieldrequired -
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.
-
metricsDataframeEvaluationOutlierDetectionMetrics -
Specifies the metrics that are used for the evaluation.
-
auc_rocDataframeEvaluationClassificationMetricsAucRoc -
The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive.
-
class_namestring Name -
Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes.
-
include_curveboolean -
Whether or not the curve should be returned in addition to the score. Default value is false.
-
precisionmap string to object -
Precision of predictions (per-class and average).
-
recallmap string to object -
Recall of predictions (per-class and average).
-
confusion_matrixmap string to object -
Accuracy of predictions (per-class and overall).
-
regressionDataframeEvaluationRegression -
Regression evaluation evaluates the results of a regression analysis which outputs a prediction of values.
-
actual_fieldstring Fieldrequired -
The field of the index which contains the ground truth. The data type of this field must be numerical.
-
predicted_fieldstring Fieldrequired -
The field in the index that contains the predicted value, in other words the results of the regression analysis.
-
metricsDataframeEvaluationRegressionMetrics -
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.
-
msleDataframeEvaluationRegressionMetricsMsle -
Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value.
-
offsetnumber -
Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1.
-
huberDataframeEvaluationRegressionMetricsHuber -
Pseudo Huber loss function.
-
deltanumber -
Approximates 1/2 (prediction - actual)2 for values much less than delta and approximates a straight line with slope delta for values much larger than delta. Defaults to 1. Delta needs to be greater than 0.
-
r_squaredmap string to object -
Proportion of the variance in the dependent variable that is predictable from the independent variables.
-
indexstring IndexNamerequired -
Defines the
indexin which the evaluation will be performed. -
queryQueryContainer -
A query clause that retrieves a subset of data from the source index.
Response
-
classificationDataframeClassificationSummary -
Evaluation results for a classification analysis. It outputs a prediction that identifies to which of the classes each document belongs.
-
auc_rocDataframeEvaluationSummaryAucRoc -
The AUC ROC (area under the curve of the receiver operating characteristic) score and optionally the curve. It is calculated for a specific class (provided as "class_name") treated as positive.
-
accuracyDataframeClassificationSummaryAccuracy -
Accuracy of predictions (per-class and overall).
-
classesDataframeEvaluationClassrequired -
valuenumberrequired -
class_namestring Namerequired -
overall_accuracynumberrequired -
multiclass_confusion_matrixDataframeClassificationSummaryMulticlassConfusionMatrix -
Multiclass confusion matrix.
-
confusion_matrixConfusionMatrixItemrequired -
actual_classstring Namerequired -
actual_class_doc_countnumberrequired -
predicted_classesConfusionMatrixPredictionrequired -
predicted_classstring Namerequired -
countnumberrequired -
other_predicted_class_doc_countnumberrequired -
other_actual_class_countnumberrequired -
precisionDataframeClassificationSummaryPrecision -
Precision of predictions (per-class and average).
-
classesDataframeEvaluationClassrequired -
valuenumberrequired -
class_namestring Namerequired -
avg_precisionnumberrequired -
recallDataframeClassificationSummaryRecall -
Recall of predictions (per-class and average).
-
classesDataframeEvaluationClassrequired -
valuenumberrequired -
class_namestring Namerequired -
avg_recallnumberrequired -
outlier_detectionDataframeOutlierDetectionSummary -
Evaluation results for an outlier detection analysis. It outputs the probability that each document is an outlier.
-
auc_rocDataframeEvaluationSummaryAucRoc · 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.
-
confusion_matrixmap string to ConfusionMatrixThreshold -
Set the different thresholds of the outlier score at where the metrics (
tp- true positive,fp- false positive,tn- true negative,fn- false negative) are calculated. -
regressionDataframeRegressionSummary -
Evaluation results for a regression analysis which outputs a prediction of values.