# ML Regression Metrics Calculator

> ML Regression Metrics Calculator is a paid API for AI agents from ml-metrics.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Computes a comprehensive suite of regression evaluation metrics (MAE, MSE, RMSE, R², adjusted R², MAPE, SMAPE, explained variance, median absolute error, max error) from arrays of actual and predicted values.

## Facts

- Endpoint: GET https://ml-metrics.x402tookit.com/regression-metrics?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ml-regression-metrics-calculator-8bea5f62
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_57ludvbpIvPWjuG-TIrLT

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ml-regression-metrics-calculator-8bea5f62
```

Example prompt: Can you compute regression metrics — MAE, RMSE, R², and adjusted R² — for these actual values [1.2, 3.4, 2.8, 5.1] and predicted values [1.0, 3.6, 2.5, 5.3] using 2 predictors?

## When to prefer this

Use this endpoint when you need a comprehensive set of standard regression evaluation metrics in a single call, especially when you need adjusted R² alongside MAPE/SMAPE. Prefer over custom implementations when you need bias notes, SMAPE edge case handling, and a summary verdict without writing evaluation code yourself.

## Known failure modes

- Mismatched array lengths between actual and predicted return an error
- Too few samples relative to predictors makes adjusted R² undefined (needs n > p + 1)
- Non-numeric or malformed comma-separated values cause parse errors
- MAPE undefined when actual values contain zeros
- Very large arrays (>10000 values) rejected

## How this service works

MAE, MSE, RMSE, R2, adjusted R2, MAPE, SMAPE, explained variance, median and max error from actual vs predicted numbers.

## Output

A JSON object containing regression error metrics: MAE, MSE, RMSE, R², adjusted R² (if predictors provided), MAPE percent, SMAPE percent, explained variance, median absolute error, max error, mean error, and sample count. May also include notes on bias, SMAPE edge cases, degraded computation warnings, and a summary verdict.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "actual",
      "predicted"
     ],
     "properties": {
      "actual": {
       "type": "string",
       "description": "True values, comma-separated or JSON array, up to 10000"
      },
      "predicted": {
       "type": "string",
       "description": "Predicted values, same length as actual"
      },
      "predictors": {
       "type": "integer",
       "description": "Number of model predictors p (1 to 1000) for adjusted R2; needs n > p + 1"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "r2": {
       "type": [
        "null",
        "number"
       ]
      },
      "mae": {
       "type": [
        "null",
        "number"
       ]
      },
      "mse": {
       "type": [
        "null",
        "number"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "rmse": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "biasNote": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "maxError": {
       "type": [
        "null",
        "number"
       ]
      },
      "meanError": {
       "type": [
        "null",
        "number"
       ]
      },
      "smapeNote": {
       "type": [
        "null",
        "string"
       ]
      },
      "adjustedR2": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ml-regression-metrics-calculator-8bea5f62/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ml-metrics.x402tookit.com](https://www.zero.xyz/host/ml-metrics.x402tookit.com/llms.txt)
