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.
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.
metricsobject
Specifies the metrics that are used for the evaluation.
auc_rocobject
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 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.
precisionmapstring to object
Precision of predictions (per-class and average).
recallmapstring to object
Recall of predictions (per-class and average).
accuracymapstring to object
Accuracy of predictions (per-class and overall).
multiclass_confusion_matrixmapstring to object
Multiclass confusion matrix.
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.
metricsobject
Specifies the metrics that are used for the evaluation.
auc_rocobject
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 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.
precisionmapstring to object
Precision of predictions (per-class and average).
recallmapstring to object
Recall of predictions (per-class and average).
confusion_matrixmapstring to object
Accuracy of predictions (per-class and overall).
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.
msemapstring 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.
offsetnumber
Defines the transition point at which you switch from minimizing quadratic error to minimizing quadratic log error. Defaults to 1.
huberobject
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_squaredmapstring to object
Proportion of the variance in the dependent variable that is predictable from the independent variables.
indexstringrequired
Defines the index in which the evaluation will be performed.
Evaluation results for a classification analysis.
It outputs a prediction that identifies to which of the classes each document belongs.
auc_rocobject
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.
valuenumberrequired
curveobject[]
tprnumberrequired
fprnumberrequired
thresholdnumberrequired
accuracyobject
Accuracy of predictions (per-class and overall).
classesobject[]required
valuenumberrequired
class_namestringrequired
overall_accuracynumberrequired
multiclass_confusion_matrixobject
Multiclass confusion matrix.
confusion_matrixobject[]required
actual_classstringrequired
actual_class_doc_countnumberrequired
predicted_classesobject[]required
predicted_classstringrequired
countnumberrequired
other_predicted_class_doc_countnumberrequired
other_actual_class_countnumberrequired
precisionobject
Precision of predictions (per-class and average).
classesobject[]required
valuenumberrequired
class_namestringrequired
avg_precisionnumberrequired
recallobject
Recall of predictions (per-class and average).
classesobject[]required
valuenumberrequired
class_namestringrequired
avg_recallnumberrequired
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.
valuenumberrequired
curveobject[]
tprnumberrequired
fprnumberrequired
thresholdnumberrequired
precisionmapstring to number
Set the different thresholds of the outlier score at where the metric is calculated.
recallmapstring to number
Set the different thresholds of the outlier score at where the metric is calculated.
confusion_matrixmapstring to object
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.
<string>object
tpnumberrequired
True Positive
fpnumberrequired
False Positive
tnnumberrequired
True Negative
fnnumberrequired
False Negative
regressionobject
Evaluation results for a regression analysis which outputs a prediction of values.
huberobject
Pseudo Huber loss function.
valuenumberrequired
mseobject
Average squared difference between the predicted values and the actual (ground truth) value.
valuenumberrequired
msleobject
Average squared difference between the logarithm of the predicted values and the logarithm of the actual (ground truth) value.
valuenumberrequired
r_squaredobject
Proportion of the variance in the dependent variable that is predictable from the independent variables.