Classification metrics compute

classification-metrics-compute · version 1.0.0 · Numbers & math · free, no key needed

Compute exact binary-classification metrics from integer confusion-matrix counts as reduced fractions or null.

Use when you need to: compute binary classification metrics · confusion matrix precision recall and f1 · exact accuracy from tp fp tn fn.

Decide before calling

Read the versioned contract and the supported scope below. Reuse classification-metrics-compute@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use classification-metrics-compute@1.0.0 for compute binary classification metrics. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "tp": 42,
  "fp": 8,
  "tn": 45,
  "fn": 5
}

Response:

{
  "result": {
    "total": 100,
    "accuracy": "87/100",
    "precision": "21/25",
    "recall": "42/47",
    "specificity": "45/53",
    "f1": "84/97",
    "negative_predictive_value": "9/10",
    "prevalence": "47/100",
    "balanced_accuracy": "4341/4982"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "classification-metrics-compute",
  "version": "1.0.0",
  "input": {
    "tp": 42,
    "fp": 8,
    "tn": 45,
    "fn": 5
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/classification-metrics-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"tp":42,"fp":8,"tn":45,"fn":5}'

The machine-readable contract is at /v1/tools/classification-metrics-compute/versions/1.0.0.

CLI

node cli.mjs run classification-metrics-compute 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.