Classification evaluation

Evaluate binary classification performance across thresholds.
View as Markdown

The Classification evaluation view returns performance metrics for a deployed classification model.

Use it to evaluate binary classification performance, inspect threshold-dependent trade-offs, and review global metrics such as PR AUC and ROC AUC.

When to use

Use caseDescription
Evaluate classification performanceReview threshold-level and global classification metrics.
Choose a decision thresholdCompare precision, recall, false positives, false negatives, and related metrics across thresholds.
Compare train and test performanceUse observation_type to evaluate precomputed train, test, or all observations.
Evaluate a query batchProvide query rows and target observations to evaluate a submitted batch.

Generate the view

Generate the Classification evaluation view from a deployed model.

POST
/deployed-models/:deployedModelId/views
curl -X POST https://api.hi.umnai.com/deployed-models/deployedModelId/views \
-H "X-Views-Cache-Control: no-cache, no-store" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"view_type": "CLASSIFICATION_EVALUATION"
}
],
"query": {
"age": [
58
],
"capital_45_gain": [
0
],
"capital_45_loss": [
0
],
"education": [
"HS-grad"
],
"educational_45_num": [
9
],
"fnlwgt": [
299831
],
"gender": [
"Male"
],
"hours_45_per_45_week": [
35
],
"marital_45_status": [
"Married-civ-spouse"
],
"native_45_country": [
"United-States"
],
"occupation": [
"?"
],
"race": [
"White"
],
"relationship": [
"Husband"
],
"workclass": [
"?"
]
},
"targets": {
"income": [
0
]
}
}'
Response
{
"data": [
{
"view_type": "CLASSIFICATION_EVALUATION",
"output_version": {
"major_version": 3,
"minor_version": 3,
"patch_version": 0
},
"views_version": {
"major_version": 0,
"minor_version": 5,
"patch_version": 0,
"build_version": "dev76"
},
"view_data": {
"threshold_metrics": {
"columns": [
"decision_threshold",
"log_loss_mean",
"log_loss_median",
"log_loss_mode",
"log_loss_var",
"log_loss_std",
"log_loss_iqr",
"true_positives",
"false_negatives",
"false_positives",
"true_negatives",
"tpr",
"tnr",
"fdr",
"for",
"fpr",
"fnr",
"mcc",
"fm",
"csi",
"precision",
"recall",
"f1_score",
"accuracy"
],
"index": [
0
],
"data": [
[
0.27,
0.3175347003,
0.3175347003,
0.3175347003,
0,
0,
0,
0,
0,
1,
0,
0,
0,
1,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"foreign_keys": [],
"labels": [],
"types": [
{
"data_type": "NUMBER",
"format": "FLOAT64"
},
{
"data_type": "NUMBER",
"format": "FLOAT64"
},
{
"data_type": "NUMBER",
"format": "FLOAT64"
},
{
"data_type": "NUMBER",
"format": "FLOAT64"
},
{
"data_type": "ANY"
},
{
"data_type": "ANY"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "ANY"
},
{
"data_type": "NUMBER",
"format": "INT64"
}
]
},
"global_metrics": {
"columns": [
"pr_auc",
"roc_auc"
],
"index": [
0
],
"data": [
[
0,
0
]
],
"foreign_keys": [],
"labels": [],
"types": [
{
"data_type": "NUMBER",
"format": "INT64"
},
{
"data_type": "NUMBER",
"format": "INT64"
}
]
}
}
}
]
}

The request needs view_type set to CLASSIFICATION_EVALUATION.

You can evaluate either a submitted query batch with target observations, or a precomputed observation split using observation_type.

When evaluating query data, provide both query and targets. When evaluating precomputed observations, set observation_type to TRAIN, TEST, or ALL.

Output

The response follows the shared Response structure format.

The Classification evaluation view returns multiple named dataframes inside view_data.

DataframeDescription
threshold_metricsMetrics calculated at each decision threshold.
global_metricsMetrics that summarize model performance independently of a specific threshold.

Interpret the result

The Classification evaluation view is easiest to read in two passes: use global metrics to understand overall separability, then use threshold metrics to choose or review an operating point.

Start with global metrics

Use global_metrics to understand the model’s overall classification performance.

roc_auc measures how well the model separates classes across thresholds. pr_auc summarizes precision-recall performance and is especially useful when the positive class is rare or class balance matters.

Global metrics are useful for comparing models or splits, but they do not tell you which decision threshold to use.

Review threshold metrics

Use threshold_metrics to understand performance at each decision_threshold.

Each row shows how the model behaves when predicted probabilities are converted into binary predictions at that threshold. Review the confusion counts first, then use derived metrics such as precision, recall, F1 score, accuracy, and MCC.

Choose an operating point

Use decision_threshold to compare the trade-off between false positives and false negatives.

Lower thresholds usually increase positive predictions, which may increase recall but also increase false positives. Higher thresholds usually reduce positive predictions, which may improve precision but increase false negatives.

Choose the threshold that best matches the cost of each error type in your application.

Inspect confusion counts

Use true_positives, false_negatives, false_positives, and true_negatives to understand the raw classification outcomes at each threshold.

These counts are often easier to reason about than derived metrics, especially when communicating performance to non-technical stakeholders.

Compare evaluation sources

Use observation_type when you want to evaluate train, test, or all precomputed observations.

Comparing TRAIN and TEST results can help identify overfitting or performance drift between the data used to train the model and the data used to evaluate it.

Options

The Classification evaluation view supports options for selecting evaluation data and thresholds.

OptionUse
observation_typeEvaluate precomputed TRAIN, TEST, or ALL observations.
decision_thresholdSet one decision threshold or a list of thresholds to evaluate.

Observation type

Use observation_type when you want the evaluation to run against precomputed observations.

Observation typeDescription
TRAINEvaluate on training observations.
TESTEvaluate on test observations.
ALLEvaluate on both training and test observations.

When observation_type is not provided, the view evaluates the query and target data supplied in the request.

Decision threshold

Use decision_threshold to control the probability threshold used to convert predicted probabilities into class predictions.

You can provide a single number or a list of numbers between 0 and 1. The view may include additional threshold rows beyond the thresholds you provide.

Field reference

The Classification evaluation view returns dataframes, so individual columns are not documented as standalone API schema properties.

threshold_metrics

The threshold_metrics dataframe contains metrics calculated at each decision threshold.

FieldDescription
decision_thresholdThreshold used to convert predicted probabilities into class predictions.
log_loss_meanMean log loss.
log_loss_medianMedian log loss.
log_loss_modeMode log loss.
log_loss_varVariance of log loss.
log_loss_stdStandard deviation of log loss.
log_loss_iqrInterquartile range of log loss.
true_positivesNumber of actual positives correctly predicted as positive.
false_negativesNumber of actual positives incorrectly predicted as negative.
false_positivesNumber of actual negatives incorrectly predicted as positive.
true_negativesNumber of actual negatives correctly predicted as negative.
tprTrue positive rate, also known as recall or sensitivity.
tnrTrue negative rate, also known as specificity.
fdrFalse discovery rate, the proportion of predicted positives that are false positives.
forFalse omission rate, the proportion of predicted negatives that are false negatives.
fprFalse positive rate, the proportion of actual negatives predicted as positive.
fnrFalse negative rate, the proportion of actual positives predicted as negative.
mccMatthews correlation coefficient, a balanced classification quality metric.
fmFowlkes-Mallows index, the geometric mean of precision and recall.
csiCritical success index, the ratio of true positives to true positives, false positives, and false negatives.
precisionProportion of predicted positives that are true positives.
recallProportion of actual positives correctly predicted as positive.
f1_scoreHarmonic mean of precision and recall.
accuracyProportion of correctly classified observations.

Log loss is the negative log-likelihood of the predicted probabilities. It penalizes confidently incorrect predictions.

global_metrics

The global_metrics dataframe contains threshold-independent metrics.

FieldDescription
pr_aucArea under the precision-recall curve. Useful when class balance matters or the positive class is rare.
roc_aucArea under the receiver operating characteristic curve. Measures class separability across thresholds.