Skip to main content

Job Metrics

POST /api/v2/metrics/job

Description

The job endpoint retrieves detailed performance metrics and statistics for a specific Arcanna job. This endpoint provides comprehensive analytics including accuracy metrics, confusion matrix, model performance data, and time-based statistics for job evaluation and monitoring.

Quick Start Examples

Get metrics for a specific job

curl -X POST "https://your.arcanna.ai/api/v2/metrics/job?job_id=1234" \
-H "X-Arcanna-Api-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{}'

Get metrics with custom time range

curl -X POST "https://your.arcanna.ai/api/v2/metrics/job?job_id=1234&start_datetime=2025-01-01T00:00:00Z&end_datetime=2025-01-02T00:00:00Z" \
-H "X-Arcanna-Api-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{}'

Get metrics with filters

curl -X POST "https://your.arcanna.ai/api/v2/metrics/job?job_id=1234" \
-H "X-Arcanna-Api-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"filters": [
{
"field": "arcanna.result_label",
"operator": "is",
"value": "Escalate"
}
]
}'

Request Parameters

Query Parameters

ParameterTypeRequiredDescription
job_idinteger or stringYesThe ID of the job to retrieve metrics for
start_datetimestringNoStart date for metrics (ISO 8601 format)
end_datetimestringNoEnd date for metrics (ISO 8601 format)

Request Body (Optional)

{
"filters": [
{
"field": "string",
"operator": "string",
"value": "string"
}
]
}

Filter Parameters:

  • field: The specific data field to apply the filter to
  • operator: Comparison method ('is', 'is not', 'contains', 'exists', 'gt', 'lt', etc.)
  • value: The criteria used by the operator to filter the field

Response

Success Response (200 OK)

{
"confusion_matrix": [
[4490, 0, 0],
[0, 749, 0],
[0, 0, 37]
],
"overall_accuracy": 1.0,
"overall_f1_score": 1.0,
"overall_recall": 1.0,
"overall_precision": 1.0,
"metrics_per_decision": {
"Drop": {
"precision": 1.0,
"recall": 1.0,
"f1_score": 1.0,
"true_positives": 4490,
"true_negatives": 786,
"false_positives": 0,
"false_negatives": 0
},
"Investigate": {
"precision": 1.0,
"recall": 1.0,
"f1_score": 1.0,
"true_positives": 749,
"true_negatives": 4527,
"false_positives": 0,
"false_negatives": 0
},
"Escalate": {
"precision": 1.0,
"recall": 1.0,
"f1_score": 1.0,
"true_positives": 37,
"true_negatives": 5239,
"false_positives": 0,
"false_negatives": 0
}
},
"start_time": "2025-01-01T00:00:00Z",
"end_time": "2025-01-02T00:00:00Z",
"time_saved_minutes": 1250.5,
"active_model_id": "generic-1-1234-model-1747385873.hdf5",
"all_model_ids": ["generic-1-1234-model-1747385873.hdf5"],
"total_events": 5276,
"total_events_in_knowledge_base": 2516,
"total_events_with_consensus": 5,
"changed_consensus_after_training": {
"total_events": 0,
"top_events_ids": [],
"top_buckets_ids": []
}
}

Error Response (404 Not Found)

{
"error": "Job not found"
}

Response Fields

Core Metrics

  • confusion_matrix: 2D array representing the confusion matrix of model decisions
  • overall_accuracy: Mean accuracy across all decisions (0-1)
  • overall_f1_score: Mean F1 score across all decisions (0-1)
  • overall_recall: Mean recall across all decisions (0-1)
  • overall_precision: Mean precision across all decisions (0-1)

Decision-Level Metrics

  • metrics_per_decision: Object containing metrics for each decision type:
    • precision: Precision score for this decision type
    • recall: Recall score for this decision type
    • f1_score: F1 score for this decision type
    • true_positives: Number of true positive predictions
    • true_negatives: Number of true negative predictions
    • false_positives: Number of false positive predictions
    • false_negatives: Number of false negative predictions

Additional Information

  • start_time: Start time for the computed metrics period
  • end_time: End time for the computed metrics period
  • time_saved_minutes: Estimated time saved by Arcanna (in minutes)
  • active_model_id: ID of the currently active model
  • all_model_ids: List of all model IDs associated with this job
  • total_events: Total number of events processed
  • total_events_in_knowledge_base: Number of events in the knowledge base
  • total_events_with_consensus: Number of events with consensus
  • changed_consensus_after_training: Object containing information about events that changed consensus after training
    • total_events: Total number of events that changed consensus
    • top_events_ids: List of top 10 events IDs that changed consensus
    • top_buckets_ids: List of top 10 buckets IDs that changed consensus